|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Hi. I'm getting this error when trying to execute the following php code.
Warning: Supplied argument is not a valid MySQL result resource in /export/vol2/httpd/htdocs/academic/engineering/leap/test.php on line 22 code: 21. $query = mysql_db_query($database,"SELECT * FROM users",$link_id); 22. $result = mysql_fetch_array($query); This code works with no errors on my home machine. I have established a connection and $database and $link_id are correct. The databases are on different systems, but i used the same statements to create them. I have the same privledges in each database. Any ideas what could be causing this error?? ---John Holmes ---www.SepodatiCreations.com |
|
#2
|
|||
|
|||
|
Are you sure $link_id is correct? Try dropping it as it isn't neccesary unless you have multiple connections to multiple mysql servers open.
|
|
#3
|
||||
|
||||
|
I tried this code and am still getting the same errors:
20: $link_id = mysql_connect("localhost","johnson","tifdrjee"); 21: $query = mysql_db_query($database,"SELECT * FROM users"); 22: $result = mysql_fetch_array($query); If this works in one database, what could be different in the other database to not allow this? ---John Holmes |
|
#4
|
|||
|
|||
|
Have you printed $link_id? You may not be getting connected. Try this after the connect:
if (!$link_id) print mysql_error(); I bet you'll find something is wrong with the mysql userid or password. Are you POSITIVE they are the same on both servers? |
|
#5
|
||||
|
||||
|
It says $link_id is set ok.
On my home computer I deleted the extensions_dir setting in the php.ini file and when i loaded up the page, it gave me this same error, so i think the problem might be with their php.ini file on the server. (????) ---John Holmes |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Help - Supplied argument is not a valid MySQL result resource??? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|