Forum Moderators: coopster
Someone else kindly built a database for one of my sites and provided me with the php etc and it works great on there.
To enable me to play around with it, ive just signed up and got a new host and domain, uploaded the mysql database and scripts (just one php file) and changed my username/password/databaseName etc
but when i go to load the index.php file, i get error messages at the top of the page. the page loads but not properly.
I just wondered, is all mysql/php compatible from host to host?
These are the errors i get at top of page:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/username/public_html/widgets/functions.php on line 102
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/widgets/functions.php on line 103
many thanks, chris
Could it be anything to do with i'm using a temporary website address until my domain becomes active?
e.g [wwwtempdomain.net...]
This error comes when your query fails to execute
try adding this line after your line 102 (where error comes)
echo mysql_error();
it should display an error message on the screen .. which can give some clue.
..temporary site should not be any problem.
Test for an error after mysql_connect, mysql_select_db, mysql_query and mysql_fetch_array.
As soon as you get an error run mysql_error() which will give you a better description of the problem.
daisho
$_GET['location']
See Predefined Variables [php.net].
There are 3 things needed to use the mysql_connect() function in PHP. They are:
My host adds an underscore automatically (dont know why?)to any database name i create and also adds one to the front of my user name when i create one.
but in my php file only my database name required the underscore and not the username, e.g
mysql_select_db ("hostputthis_icalleditthis");
thanks again for all your help