Jump to content

Ingenious

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by Ingenious

  1. Hi, the problem that I have goes like this. If i do a regular Select query and display it in a table everything is there but if i am filling a input box of a form to use for modifying the values it does not return the entire value: Exemple with the same value in a table = product_name : Amd Athlon X2 In input field : Amd Here is my code <? $sql = "SELECT * FROM tbl_product WHERE product_code = '$_POST[productcode]'"; $result = mysql_query($sql); if(!$result){ die("Error running $sql:" . mysql_error()); } ?> <? while($row = mysql_fetch_array($result)) { echo " <form action='functions/moditem.php' method='post'> <input type='hidden' name='productid' value=". $row['product_id'] ."> Product code : <input type='text' name='productcode' value=". $row['product_code'] ." /><br /> Product Name : <input type='text' name='productname' value=". $row['product_name'] ." /><br /> Product Price: <input type='text' name='productprice' value=". $row['product_price'] ." /><br /> <input type='submit' value='Modify' /> </form> "; }
  2. Good day, I have 2 questions about that. Here is the context. I have a list of items that i query from a database and insert in a table. The last field of the table is a input box to typpe in the quantity ("qty"). My first question, how can I associate the inputbox to product_id from the database for that item. //database connecting is working <? while($row = mysql_fetch_array($result)) { echo "<tr><td>" . $row['product_code'] . "</td><td>" . $row['product_name'] . "</td><td><input type='text' maxlength = '3' value='0'></td></tr>"; } And my second question (any tutorial reference) about how to select only the items that the qty is not = 0 and pass it to another page either by sessions or other means. Thank you
  3. Good day, I am looking for the replacement for session_is_registered. anyone has any idea? <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html> Thank you very much
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.