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...

----- Original Message -----
From: "Tyler Whitesides" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 8:24 AM
Subject: [PHP-DB] Undefined Constant


    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?


$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);

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to