Jump to content

dirt

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dirt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks man for the input. i got it workin...some silly syntax error. it was my fault. Thanks Again
  2. i have tried everything...i still dont know wat to do. [code]<?php require_once('Connections/ren.php'); ?><?php mysql_select_db($database_ren, $ren); $query= "SELECT membership FROM user WHERE username='".$_COOKIE['username']."'"; $usr = mysql_query($query, $ren) or die(mysql_error()); $row_usr = mysql_fetch_assoc($usr); $limit=$row_usr['membership']; $count=0; if (isset($_POST['save']) && (isset($_COOKIE['usrname'])) ) {    foreach($_POST as $key => $val){          if(substr($key,0,3)=="buy"){ $query="INSERT INTO buy ( user , movies )VALUES ('".$_COOKIE['usrname']."', '".$val."');"; mysql_query($query) or die(mysql_error()); $username = $_COOKIE['usrname']; $query=mysql_query("SELECT COUNT(*) FROM buy WHERE user = '$username'"); $purchsed=mysql_num_rows($query); mysql_close(); echo("<center><font color=red>You have purchased $purchased DVD(s) </font></center>");}            } if($count < $limit){       if(substr($key,0,4)=="rent"){ $query="INSERT INTO rent ( user , movie )VALUES ('".$_COOKIE['username']."', '".$val."');";           mysql_query($query, $ren) or die(mysql_error()); $username = $_COOKIE['usrname']; $query=mysql_query("SELECT COUNT(*) FROM buy WHERE user = '$username'"); $rented=mysql_num_rows($query); mysql_close(); echo("<center><font color=red>You have purchased $rented DVD(s) </font></center>");               }       }else{         echo "<center><font color=red>Limit Exceeded!! Only $limit is rented!! </font></center>";       }    } } if (isset($_POST['save']) && (!isset($_COOKIE['username'])) ) {    echo "<center><font color=red>Please Login</font></center>"; } [/code] and the output is :- You have purchased DVD's Limit Exceeded!! Only is rented!! Limit Exceeded!! Only is rented!! Limit Exceeded!! Only is rented!!
  3. i need to get the outcome that says a customer has bought X ammount of DVD either in the same page or diff page. I am reloading to the same page when i click the submit button(but without the outcome)
  4. i am not getting the output that i want.is there anything i need to add...or mayb i forgot to do something [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php require_once('Connections/ren.php'); ?><?php mysql_select_db($database_ren, $ren); $query= "SELECT membership FROM user WHERE username='".$_COOKIE['usrname']."'"; $usr = mysql_query($query, $ren) or die(mysql_error()); $row_usr = mysql_fetch_assoc($usr); $limit=$row_usr['membership']; $count=0; if (isset($_POST['save']) && (isset($_COOKIE['usrname'])) ) { foreach($_POST as $key => $val){ if(substr($key,0,3)=="buy"){ $query="INSERT INTO buy ( user , movies )VALUES ('".$_COOKIE['usrname']."', '".$val."');"; mysql_query($query, $ren) or die(mysql_error()); $query=myslq_query("SELECT COUNT(*) FROM buy WHERE user = '$username'"); $rented=mysql_result($query, 0); echo("<center><font color=red>You have rented $rented DVD's </font></center>");[/quote]
  5. but what if i did the codings differently...somethimg like this if(substr($key,0,3)=="buy"){ query="INSERT INTO buy ( user , movies )VALUES ('".$_COOKIE['usrname']."', '".$val."');"; mysql_query($query, $ren) or die(mysql_error()); where do i put echo("You have rented $ DVD's");?? i dont mind showin the echo output in the same page...
  6. i have this online dvd rental system... i need to make sure the priority is set for every single members level...i have set their priority but i need a output that says "You have rented X amount of DvD's" once the member hits the submit button.
  7. thanks. Is there any snippets of any coding that might help me with the 'if' statement?? really would be a great help.thanks again
  8. i have created registry for new users. how do i set the priorities of the members. for the user that chooses package one can only choose one item if it is package two the user can choose two items. how do i go about.
×
×
  • 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.