Re: [PHP] DUMB QUESTION I'M SURE
Hi, Friday, January 3, 2003, 4:18:05 PM, you wrote: AF I'm just starting out, this is my script... AF ? AF $name = $_POST['username']; AF $name = $name; AF $db = mysql_connect(localhost); AF mysql_select_db(vinyldealers,$db); AF $query = SELECT shops.name FROM shops WHERE name = .$name.; AF $result = mysql_query($query); AF while ($record = mysql_fetch_assoc($result)) { AF while (list($feildname, $feildvalue) = each ($record)) { AF echo $feildname. : B .$feildvalue. /BBR; AF } AF echoBR; AF } ? AF This is the error I get... AF Parse error: parse error, unexpected ':' in AF C:\Xitami\webpages\php\result1.php on line 12 AF I dunno what I'm doing wrong. Help please??? Don't need the . at the end of this line: $query = SELECT shops.name FROM shops WHERE name = .$name.; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DUMB QUESTION I'M SURE
Try by adding a backslash to the : there (...\: B...) Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] 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.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? 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
RE: [PHP] DUMB QUESTION I'M SURE
What they mean is to make that line: $query = SELECT shops.name FROM shops WHERE name = $name; Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Adam French [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 03 de enero de 2003 3:18 Para: [EMAIL PROTECTED] 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.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? 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
Re: [PHP] DUMB QUESTION I'M SURE
I think it's just the $query var not having the right number of quotes. I added single quotes around the value. ? $name = $_POST['username']; $name = $name; $db = mysql_connect(localhost); mysql_select_db(vinyldealers,$db); $query = SELECT shops.name FROM shops WHERE name = '.$name.'; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? HTH, Jason k Larson Adam French wrote: 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.; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while (list($feildname, $feildvalue) = each ($record)) { echo $feildname. : B .$feildvalue. /BBR; } echoBR; } ? 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
RE: [PHP] DUMB QUESTION I'M SURE
Quoting Cesar Aracena [EMAIL PROTECTED]: ### Try by adding a backslash to the : there (...\: B...) ### ### Cesar L. Aracena ### [EMAIL PROTECTED] ### [EMAIL PROTECTED] ### (0299) 156-356688 ### Neuquén (8300) Capital ### Argentina ### ### ### -Mensaje original- ### De: Adam French [mailto:[EMAIL PROTECTED]] ### Enviado el: viernes, 03 de enero de 2003 3:18 ### Para: [EMAIL PROTECTED] ### 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. /BBR; ### } ### echoBR; ### } ### ? ### ### 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 ### ### -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php