[PHP] I don't understand...

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Re: [PHP] I don't understand...

    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.

    --
    The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.


    Leif K-Brooks Guest

  2. Similar Questions and Discussions

    1. AWEDBFILES4 ?? I don't understand!
      No one in other forums were able to help me so I will try here now. I have legit versions of all of my Adobe programs and I have registered 1 of...
    2. If you can understand DBI internals...
      and how it links up to DBD::mysql, then you are pretty close to Perl God. Because I can't make heads or tails of it. But I can tell that...
    3. Im trying to understand php classes please help
      Im tring to learn about classes with php. I've read alot of posts here and look at other peoples code. So I appied all the absorbed to this. Im...
    4. Do not understand Hashes !
      I have a problem with hashes and trying to understand them, I have read the perldoc intersection and looked into the Perl Cookbook, and still do...
    5. I don't understand why this happen
      open my $fh, "<", "items/list.db"; print while (<$fh>); close $fh; This is suppose to printout the content in items/list.db , but why I get...
  3. #2

    Default Re: [PHP] I don't understand...

    >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.
    >

    John Manko Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139