Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
my mysql query stopped working?
Old 08-08-2008, 03:13 PM my mysql query stopped working?
Junior Talker

Posts: 2
Trades: 0
I have mode no modifications to a mySQL query that has been working for years but now, it returns no errors but also returns no rests no matter what I search. Any help would be appreciated



Code:
if  ($search)      //  perform  search  only  if  a  string  was  entered. 
     { 
       mysql_connect("localhost", "ners_database", "pass")  or  die  ("Problem  connecting  to  Database"); 
               
       $srch= "$search"; 
       $query  =  "SELECT  *  FROM areas WHERE ZIPcode  LIKE  '$srch'  ||  City  LIKE  '$srch'  ||  Abbrev  LIKE  '$srch'  ||  State  LIKE  '$srch'  ||  County  LIKE  '$srch'"; 

       $result  =  mysql_db_query("nersreco_ners", $query); 

       if    ($result) 
       { 
       echo  "Here are your search results:<br><br>"; 
       echo  "<table  width=450px  align=center  border=1><tr> 
               <td  align=left  bgcolor=#dbecf0><strong>ZIP Code</strong></td> 
               <td  align=left  bgcolor=#dbecf0><strong>City</strong></td> 
               <td  align=left  bgcolor=#dbecf0><strong>Abbrev</strong></td> 
               <td  align=left  bgcolor=#dbecf0><strong>State</strong></td>
               <td  align=left  bgcolor=#dbecf0><strong>County</strong></td>
               </tr>"; 

               while  ($r  =  mysql_fetch_array($result))  {          
                       $zip  =  $r["ZIPcode"]; 
                       $city  =  $r["City"]; 
                       $abbrev  =  $r["Abbrev"]; 
                       $state  =  $r["State"]; 
                       $county  =  $r["County"]; 
                                   echo  "<tr> 
                                               <td>$zip</td> 
                                               <td>$city</td> 
                                               <td>$abbrev</td>
                                               <td>$state</td>
                                               <td>$county</td></tr> 
                               <tr>        <td  colspan=5  bgcolor=\"#ffffff\">$comment</td> 
                               </tr>"; 
               }                                    
               echo  "</table>"; 
         }  else  {  echo  "We apologize, our system is currently unavailable.<br>Please download our Coverage Area booklet or contact us.";  } 
     }  else  { 
     echo  "Search  form was  empty.  <br>  You must enter a keyword to search."; 
     }

Last edited by bstone995; 08-08-2008 at 03:17 PM..
bstone995 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-08-2008, 04:32 PM Re: my mysql query stopped working?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Have you looked to see whether your data has changed, or to trace the request?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 08-08-2008, 04:48 PM Re: my mysql query stopped working?
Junior Talker

Posts: 2
Trades: 0
Yeah I have tested everything... nothing has changed. I think it may have something to do with my host updating their version of mysql? Not sure, hoping someone could spot a problem.

Thanks!
bstone995 is offline
Reply With Quote
View Public Profile
 
Old 08-08-2008, 08:02 PM Re: my mysql query stopped working?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I wouldn't be able to confirm or deny that, but I doubt it's the case. In Microsoft Land, when an update to the core database engine breaks existing code, #1 it will be to more complicated code than what you've posted, usually involving esoteric options and query hints, and #2 you'll get an error message telling you what happened. It's often a cryptic error message, but you'll still get some type of notification.

What did your testing cover, and what did it reveal?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to my mysql query stopped working?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14276 seconds with 12 queries