Re: I don't understand...

From: Date: Thu, 31 Jul 2003 07:36:09 +0000
Subject: Re: I don't understand...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-157681@lists.php.net to get a copy of this message
You're trying to assign to a function, seriousley messed up. I reccomend you make sure you know PHP before going any >further.
Leif, Let's try and be a little more constructive..... Jason, mysql_query is a function, so you need to "call" it, not "assign to it". For example..... (is this a little of Java crap mixed in here? VB?) mysql_query("Select * from mytable"); so, change your code to the following (making a variable $query)... $query = "Select "; Now, I'm not sure where you are getting the mysql_fetch_array($sql_uc, MYSQL_ASSOC) from, but there are a few problems here. First, it;s most likely that you dont have a result-set to fetch an array from. Also, you forgot the trailing ")" in the while statement.
      while ($result = mysql_fetch_array($sql_uc, MYSQL_ASSOC) )
      {
          $query .= " {$result['field_name']} as {$result['display']} ";
      }
          $query .= " from $season";
          mysql_query($query);
I suggest you do a google search for "php mysql_query" Leif K-Brooks wrote:
Jason Martyn wrote:
Here's kinda what I'm trying to do (not working of course).
[snip unimportant code]
       mysql_query = ("select");
       while ($result = mysql_fetch_array($sql_uc, MYSQL_ASSOC)
       {
           mysql_query .= (" ". $season .".".$result['field_name']." as ".$result['display'].",";
       }
              mysql_query .= ("from ".$season.";");
You're trying to assign to a function, seriousley messed up. I reccomend you make sure you know PHP before going any further.


« previous php.general (#157681) next »