So I'm trying to build a php page to edit records. Right now I'm trying to get it to take the ID in the url and return data based on that. I can echo out the id from the url, that's fine, but the sql query isn't doing anything. I threw the 2 echo's at the bottom to try to get them to display values. The ID displays fine, coming from the URL, but it should display the name corrosponding with that gigid and isn't.
Any ideas?
<?php
// query db
$gigid = $_GET['gigid'];
$result = ORM::for_table('gigs')->where('gigid', $gigid)
or die(mysql_error());
$row = mysqli_fetch_array($result);
// check that the 'id' matches up with a row in the databse
if($row)
{
// get data from db
$gig_name = $row['gig_name'];
$gig_type = $row['gig_type'];
$gig_date = $row['gig_date'];
$gig_customer = $row['gig_customer'];
$gig_venue = $row['venue_name'];
$gig_fee = $row['gig_fee'];
$gig_status = $row['gig_status'];
}
mysqli_close($con);
?>
<?php echo $gigid; ?>
<?php echo $gig_name; ?>