RE: [PHP] DUMB QUESTION I'M SURE

From: Date: Fri, 03 Jan 2003 06:38:03 +0000
Subject: RE: [PHP] DUMB QUESTION I'M SURE
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-130061@lists.php.net to get a copy of this message
Quoting Cesar Aracena <icaam@icaam.com.ar>: ### Try by adding a backslash to the : there (..."\: <B>"...) ### ### Cesar L. Aracena ### icaam@icaam.com.ar ### caracena@infovia.com.ar ### (0299) 156-356688 ### Neuquén (8300) Capital ### Argentina ### ### ### -----Mensaje original----- ### De: Adam French [mailto:afrench@westman.wave.ca] ### Enviado el: viernes, 03 de enero de 2003 3:18 ### Para: php-general@lists.php.net ### Asunto: [PHP] DUMB QUESTION I'M SURE ### ### I'm just starting out, this is my script... ### ### <? ### $name = $_POST['username']; ### $name = $name; ### $db = mysql_connect("localhost"); ### mysql_select_db("vinyldealers",$db); ### $query = "SELECT shops.name FROM shops WHERE name = ".$name."; you might also want to format the above like this: $query = "SELECT shops.name FROM shops WHERE name = $name"; you're gonna get an error in your sql syntax otherwise ### $result = mysql_query($query); ### while ($record = mysql_fetch_assoc($result)) { ### while (list($feildname, $feildvalue) = each ($record)) { ### echo $feildname. ": <B>" .$feildvalue. "</B><BR>"; ### } ### echo"<BR>"; ### } ### ?> ### ### This is the error I get... ### ### Parse error: parse error, unexpected ':' in ### C:\Xitami\webpages\php\result1.php on line 12 ### ### I dunno what I'm doing wrong. Help please??? ### ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ###

« previous php.general (#130061) next »