Jump to content

nstruth

New Members
  • Posts

    2
  • Joined

  • Last visited

nstruth's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm a noob. I was querying empty rows. The code works. Thanks
  2. I'm trying to retrieve a name from a row based on an HTML id# input. I checked print_r and var_dump for the $_POST variable, and it exists. So I think something's wrong with my SQL code. Here it is: $query = $con->prepare("SELECT name, email FROM crud WHERE id=?"); // prepate a query $query->bind_param('s', $_POST['identification']); // binding parameters via a safer way than via direct insertion into the query. 'i' tells mysql that it should expect an integer. $query->execute(); // actually perform the query $result = $query->get_result(); // retrieve the result so it can be used inside PHP $r = $result->fetch_array(MYSQLI_ASSOC); // bind the data from the first result row to $r echo $r['name']; // will return the price Please help
×
×
  • 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.