Re: MySQL error, what's wrong here..

From: Date: Tue, 24 Jul 2001 04:40:34 +0000
Subject: Re: MySQL error, what's wrong here..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59297@lists.php.net to get a copy of this message
maybe my sql syntax is completely wrong, but the "$id" part was a random number i generated, and then I was saying WHERE songid(which is the database field) is equal to $id. is that the wrong way? the reason why it's songid in that second <a> tag is because I wanted the random number to indentify the song pulled from the database..so the database uses that number in the part where it says..."stream.php?songid=<?php echo $id;?> tell me if I need to clarify! chris ----- Original Message ----- From: Christopher Ostmo <tech@appideas.com> To: Chris Cocuzzo <cuzo@mediaone.net> Cc: <php-general@lists.php.net> Sent: Monday, July 23, 2001 10:38 PM Subject: Re: [PHP]MySQL error, what's wrong here.. > Chris Cocuzzo pressed the little lettered thingies in this order... > > > alright, new problem, no more errors, but there's just nothing...here's the > > code: > > > > $query = "SELECT name FROM mp3 WHERE songid = '" .$id."'"; > > > > <a > > href="http://www.fplg.net/stream.php?songid=2" > > class="hov1"></a> > > > > Uhh... maybe I'm missing something here, but the URL supplies > $songid and the query is getting $id. Unless your getting $id from > somewhere other than the URL, you're going to be getting only results > with an empty songid field. Another thing to try is to "or die" your query > to check to see if the SQL syntax is OK: > $result=mysql_query($query,$connection) or die(mysql_error()); > > Good luck... > > Christopher Ostmo > a.k.a. tech@AppIdeas.com > AppIdeas.com > Innovative Application Ideas > Meeting cutting edge dynamic > web site needs since the > dawn of Internet time (1995) > > Business Applications: > http://www.AppIdeas.com/ > > Open Source Applications: > http://open.AppIdeas.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#59297) next »