Re: DUMB QUESTION I'M SURE
| From: | Tom Rogers | Date: | Fri, 03 Jan 2003 06:22:55 +0000 |
| Subject: | Re: DUMB QUESTION I'M SURE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130056@lists.php.net to get a copy of this message | ||
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. "</B><BR>";
AF> }
AF> echo"<BR>";
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