Re: Undefined Constant
| From: | Ignatius Reilly | Date: | Wed, 27 Nov 2002 07:31:48 +0000 |
| Subject: | Re: Undefined Constant | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23687@lists.php.net to get a copy of this message | ||
Well, is there an input field in your form whose name corresponds to .<?=
$row[price]; ?> ?
It is more likely that if you have a dynamic form your fields will be called
by a ID identifier, like
<INPUT name="1012">price is 12 EUR
Where 12 is the price of grommet with ID 1012 in your DB
So perhaps your javascript generator echoes the wrong field names...
HTH
Ignatius
____________________________________________
----- Original Message -----
From: "Tyler Whitesides" <whitesidest@icehouse.net>
To: <php-db@lists.php.net>
Sent: Wednesday, November 27, 2002 8:24 AM
Subject: [PHP-DB] Undefined Constant
Hi,
Although I have been working with PHP for a while, working with
Databases is something that I am only so so at. This code is supposed to
grab the price from the database given the auto_increment id is inside of
$casing. I am trying to get the $row[price] to echo so that Javascript
recieves a string, converts it to an integer, and later on in the code,
gives the user a total. Any ideas?
Thanks,
Tyler
<?
$grab = "select * from parts where id = '$casing';"; //This is line 17
$get = mysql_query($grab);
$row = mysql_fetch_row($get);
?>
var casing = parseInt(form1.<?= $row[price]; ?>.value);
<?
$grab = "select * from parts where id = '$processor';";
$get = mysql_query($grab);
$row = mysql_fetch_row($get);
?>