'm not quite sure how to finish the following script.
Everything was working fine before, but then I realized I had to update another element of a table within the same script. I'm trying to learn php/mySQL as we speak so I may be just burning out. Some help would be appreciated. Here is the script.
<?
include_once('/usr/home/fss/websites/fivestarsports.net/inc/func.inc.php');
$username = $HTTP_COOKIE_VARS['log']['username'];
$db_conn = five_connect_db();
mysql_select_db('fivestar',$db_conn);
//start script for trial period check
$sql = "SELECT * FROM `registered_mem` WHERE `username`='$username'";
$result = mysql_query($sql, $db_conn) or die(mysql_error());
$row = mysql_fetch_assoc($result);
if($row['access_type_id'] == 7){
if(($row['date_added']+=(60*3)) <= time()){
mysql_query("UPDATE `registered_mem` SET`access_type_id`='1' WHERE `username`='$username'",$db_conn) or die(mysql_error());
//This line below is new to my script which was working fine already, I just don't know how to finish it.
mysql_query("UPDATE `access_priv` SET`name`='reg_user' WHERE `id`='???????'",$db_conn) or die(mysql_error());
//end comment
echo "your are now nothing";
}}
?>
I have a trial period set up for registered users. The time they registered is stored in the database. What I'm doing here is allowing them access for a certain time, and then once their time is up, I update some things in the site. The line I am having trouble figuring out how to write is commented out. I need to update another table named access_priv by setting the name to 'reg_user' WHERE their id = the number that is in the table registered_mem in the column access_priv_id. Hopefully that makes sense. Also, can I even call two separate mysql_queries within the same if statement?
I need to fix this tonight, because we've got a huge email blast going out tomorrow.
If anyone can help I thank you. I'm on aim at dru6atmac.com if anyone is willing to help outside of the forum.