Ask a Question related to PHP Development, Design and Development.
-
Leif K-Brooks #1
Re: [PHP] I don't understand...
Jason Martyn wrote:
[snip unimportant code]>Here's kinda what I'm trying to do (not working of course).
>
You're trying to assign to a function, seriousley messed up. I reccomend> 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 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
-
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... -
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... -
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... -
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... -
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... -
John Manko #2
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:
>> [snip unimportant code]>> Here's kinda what I'm trying to do (not working of course).
>>
>> You're trying to assign to a function, seriousley messed up. I>> 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.";");
>>
> reccomend you make sure you know PHP before going any further.
>
John Manko Guest



Reply With Quote

