Jump to content

ZeTutorials101

Members
  • Posts

    7
  • Joined

  • Last visited

ZeTutorials101's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $sql = mysql_query("SELECT * FROM hacker_log"); echo '<form action="" method="POST">'; while ($row = mysql_fetch_assoc($sql)){ $ip = $row['ip']; $time = $row['time']; $id = $row['id']; echo 'IP: $ip Time: $time <input type="hidden" name="id" value="'.$id.'"><input type="submit" name="remove" value="Remove From Log">'; } echo '</form>'; if (isset($_POST['remove'])){ echo $_POST['id']; } That is my code, but when I try it.. it doesn't work.
  2. Hey guys, how can I get the value from a textbox that is in a while loop?
  3. @Psycho, Now i'm getting this: Query: SELECT id, name, description, price FROM products WHERE quantity > 0 ORDER BY id DESC Error: No database selected EDIT: Never mind - It was because I didn't include the config file In the Function.
  4. Okay, its getting late here - so I will test it tomorow morning. Thanks for the help and I hope it works.
  5. Yep, that was the first thing I did when making the config.php - I tested it and It worked.
  6. I did that as soon as I got the error, but in phpmyadmin it has no error.
  7. Hey guys - I've started coding a simple PHP mini shopping cart script, and I'm getting this error: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\cart.php on line 8 My Code is the following session_start(); $page = 'index.php'; require('config.php'); function products(){ $get = mysql_query('SELECT id, name, description, price FROM products WHERE quantity > 0 ORDER BY id DESC'); $get1 = mysql_num_rows($get); if ($get1==0){ echo "There are no products for sale at this moment, please check back later."; } else { echo "Success!"; //echo products } } mysql_close(); Any idea why i'm getting this error? How can I fix it? Thanks.
×
×
  • 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.