jm_0812
06-04-2004, 07:51 AM
Hello...I am trying to quickly learn php...lol... :eek: :eek:
but I am trying to get the results or a recordet to display by the id field that was designiated from a url variable...here i have a hard time explaining this I dont know all the terminlogies of php and mySQL..
the error i am getting is this :
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in products_detail.php on line 4
originating url:
products_detail.php?item=1
which points to:
<?php
mysql_select_db($database_conn_bank, $conn_bank);
$query_products = "SELECT id, name, info, price, FROM products WHERE id='$_GET['item']' order by id ";
mysql_query($query_products, $conn_bank) or die(mysql_error());
$row_products = mysql_fetch_assoc($products);
$totalRows_products = mysql_num_rows($products);
?>
where "conn_bank" is an outside .php file that makes the connection to the mySQL database
and the table is "products" with columns "id", "name", "info", "price"
on the body of the page i am trying to simply display this querry with these tags:
<h2><?php echo $row_products['name']; ?> <span class="footer">Price = $<?php echo $row_products['price']; ?></span> </h2>
<p> <img src="<?php echo $row_products['graphic']; ?>"/>
<br/>
<?php echo $row_products['info']; ?> </p>
<p>you chose <?php echo $_GET['item']; ?> as your item </p>
from an eager NOOOBIE Thanx ahead for any help that any one can give....
~Jason
but I am trying to get the results or a recordet to display by the id field that was designiated from a url variable...here i have a hard time explaining this I dont know all the terminlogies of php and mySQL..
the error i am getting is this :
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in products_detail.php on line 4
originating url:
products_detail.php?item=1
which points to:
<?php
mysql_select_db($database_conn_bank, $conn_bank);
$query_products = "SELECT id, name, info, price, FROM products WHERE id='$_GET['item']' order by id ";
mysql_query($query_products, $conn_bank) or die(mysql_error());
$row_products = mysql_fetch_assoc($products);
$totalRows_products = mysql_num_rows($products);
?>
where "conn_bank" is an outside .php file that makes the connection to the mySQL database
and the table is "products" with columns "id", "name", "info", "price"
on the body of the page i am trying to simply display this querry with these tags:
<h2><?php echo $row_products['name']; ?> <span class="footer">Price = $<?php echo $row_products['price']; ?></span> </h2>
<p> <img src="<?php echo $row_products['graphic']; ?>"/>
<br/>
<?php echo $row_products['info']; ?> </p>
<p>you chose <?php echo $_GET['item']; ?> as your item </p>
from an eager NOOOBIE Thanx ahead for any help that any one can give....
~Jason