Creating MySql database/table using php script

Status
Not open for further replies.

bushimports

New Member
Messages
3
Reaction score
0
Points
0
I have a php script for a link hits counter and I am trying to use a php script to create a database and table in the database to store the links.
I actually am just starting to try to learn php and don't know where to upload the scripts I want to run. I tried uploading my create.php script into the file manager and then placing a link to open it on my homepage and I get a MySql warning which says
Warning: mysql_connect() [function.mysql-connect]: Access denied for user mysql_username'@'localhost' (using password: YES) in /home/ljbush/public_html/create.php on line 2

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/ljbush/public_html/create.php on line 12
Access denied for user 'ljbush_jb'@'localhost' (using password: YES)

I also tried to import the script using PHPMyadmin , with that I get an error message that says

Error

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php
$connect = mysql_connect("localhost", "mysql_username", "mysql_password")' at line 1

Of course I have taken my username and password out above just in case it matters.
I have the intermediate version of php to use and don't know if maybe that might be the problem or not.

I also have a couple other scripts for the counter , one to add the links to the table once I get it created and one for the hitsout.
I guess the first thing to ask here is where do I upload the php scripts?
The next question is the intermediate version sufficient for me to use the scripts?
I guess if I can't figure out the proper syntax I will have to post a copy of the script and see if someone can help me with it.

I also tried creating the database and table without the script but when I hit save or go after I have filled out what I know to fill out in that part I get an alert box that pops up telling me that this is not a number.

Much thanks in advance to any of you who will help me.

my username is bushimports the url for my site is bushimports.x10hosting.com
 

Xemnas

New Member
Messages
812
Reaction score
0
Points
0
You need to log in to cPanel and select "MySQL Databases". Make sure your MySQL user exists and has the required permissions. So you shouldn't need an upgrade to PHP V2. Also, you don't import PHP scripts with phpMyAdmin. You import SQL scripts with it.
 
Status
Not open for further replies.
Top