php - Get and output ID from Mysql -
currently id <?= $store->id ?>
, works fine
but want id of mysql entry with
$id = $_get['store_id']; $query = "select * store id = '$id'"; $result = mysql_query($query); $row = mysql_fetch_array($result);
or
$id = $_get['$store->id']; $query = "select * store id = '$id'"; $result = mysql_query($query); $row = mysql_fetch_array($result);
and output <?php print $row["id"];?>
but doesn't gives me id, remains empty. doing wrong? (i aware working mysql_... not best way, that's not problem now).
if $store->id
works fine you, means you're doing wrong, , defined $store
earlier, in file. param url, need use $_get["param"]
. if $_get["store_id"]
doesn't work didn't set id in url. if want param name $store->id
, use $_get[$store->id]
, don't think that's you're looking for.
do not use mysql_* functions. takes 2 minutes change code.
you not need select current downloads
update it, can via pure sql: update store set downloads = downloads + 1 id = ?
Comments
Post a Comment