Announcement

Collapse
No announcement yet.

MySQL driving me crazy - a server issue?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hang on, I think I might have it!
    Online poker room ratings

    Comment


    • #17
      Ok, I've got rid of the error message which suggests that the query's now running through fine.

      I've got one last question then I promise I'll leave you alone!

      I'm trying to use a while loop to cycle through the database and populate various variables.

      This is the entire code:

      PHP Code:
      $recent_sql "SELECT type, price, description, hire, age, adults, requirements, overnight, picture, dim, gallerypics FROM range WHERE type='$choice'";


      while (
      $recent mysql_fetch_array($recent_sql)){
      $type=$recent['type']; 

      Now the wierd thing is that without changing the MySQL call, suddenly I'm getting error messages again saying that it's not a valid resource.

      I dont' get it ...
      Online poker room ratings

      Comment


      • #18
        you missed the $result line
        so you get
        PHP Code:
        $result=mysql_query($recent_sql);
        while (
        $row mysql_fetch_array($result)) {
         
        $type=$row['type'];  //or whatever else you want to do for each row in the result

        Last edited by DavidAllen; 28-02-2008, 00:33.
        David Allen - www.serina.co.uk

        Comment


        • #19
          You Sir are an absolute legend - not to mention a life saver.

          And you're just up the road in Amersham!

          Thanks so much for all your help!
          Online poker room ratings

          Comment


          • #20
            Originally posted by MortimerJazz View Post
            You Sir are an absolute legend - not to mention a life saver.

            And you're just up the road in Amersham!

            Thanks so much for all your help!
            No Problem - anytime. I know how frustrating minor mistakes can be
            David Allen - www.serina.co.uk

            Comment

            Working...
            X