|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
My site has always worked fine up until now. I moved hosting company and transferred the site though it keeps returning the following error:
Warning: mysql_query(): 1 is not a valid MySQL-Link resource in /home/httpd/vhosts/{myurl}/httpdocs/include_site/include_db.php on line 46 Warning: mysql_error(): 1 is not a valid MySQL-Link resource in /home/httpd/vhosts/{myurl}/httpdocs/include_site/include_db.php on line 48 Warning: mysql_errno(): 1 is not a valid MySQL-Link resource in /home/httpd/vhosts/{myurl}/httpdocs/include_site/include_db.php on line 48 Error:Cannot execute query 'SELECT * FROM ffec_news ORDER BY DISPLAY_DATE DESC LIMIT 0,1' SQL Error: Error Number: The database details are correct and it does actually pull info from the database though not without this error. My admin area for editing the pages via the web works fine and does not return any errors. When executing the query " SELECT * FROM ffec_news ORDER BY DISPLAY_DATE DESC LIMIT 0,1 " manually the result returned is correct and without any errors. This is from include_db.php (starting at line 43): <? function executeQuery( $query , &$link ) { if ( !$result = mysql_query( $query, $link ) ) { printError( "Cannot execute query '".$query."'<br>SQL Error: ".mysql_error( $link )."<br>Error Number: ".mysql_errno( $link ) ); die; } else { return $result; } } ?> As i said, my site works fine on my original hosting though now it is hosted with simply.com it just returns errors. Anyone able to shed some light on this? Thank you in advance.... |
|
#2
|
||||
|
||||
|
Did you change the host/username/password? Seems like a no-brainer, but it doesn't hurt to ask. Having this info wrong is the most common cause of the problem you're pointing out. Compare your admin area code to the breaking code and see if you can find the discrepancy.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
details are fine.... as i said, it does connect though always produces the errors.
it is very strange... |
|
#4
|
||||
|
||||
|
Maybe your new host has the error threshold set higher than your old host. Try adding an @ sign to the beginning of all database calls to suppress warnings.
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > SQL error after moving hosting company |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|