PHP and MYSQL

pranav95

New Member
Messages
44
Reaction score
0
Points
0
I try to run a mysql query in my website using php but I get the error mentioned below:-

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
 

as4s1n

New Member
Messages
174
Reaction score
4
Points
0
That usually means that there was an error with your query. However, no one can help you unless you post the code with this error.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The error message means what it says, which means that your problem lies in the query or the connection -- or you could simply have a typo in your code. You'd need to post code in order to get any more help.
 

varunaroli

New Member
Messages
4
Reaction score
0
Points
0
plz use mysql error () command.

Eg:

<?php

$query="select * from tble";

mysql_query($query) or die(mysql_error());

?>

it will help you to find out errors.
 
Last edited:

sanji41

New Member
Messages
1
Reaction score
0
Points
0
hi im connecting my db on x10hosting which uses cpanel however i can't seem to connect it, i dont know what to put on username and localhost and the dbname..please help!
 
Top