Jump to content

ooda55

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by ooda55

  1. Hi there, is it possible to join a variable and a string inside a $_POST variable inside a mysql query (UPDATE in this case) Here is what i am trying to accomplish: $update = "UPDATE mona SET STKFF='$_POST[$counter."NAME"]' WHERE id='$userid'"; if (!mysql_query($update)) { die('Error: ' . mysql_error()); } else echo " <br> Update Complete"; Its the '$_POST[$counter."NAME"]' bit that im worried about, is this possible without having to do: $foo=$counter."NAME" '$_POST[$foo]' Thanks Chris
  2. Cheers thats working perfectly now, i thought it was going to be somthing insanley complicated, completley forgot to check if it was a reserved keyword
  3. When i try to run the following code i get this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\farm\kindle1.php on line 36 $getuserid = "SELECT STKFF, BUYFF, BUYMF, COMMENT, ORDER FROM products WHERE PRODUCT = '$item'"; $userid22 = mysql_query($getuserid); while($webrow = mysql_fetch_array($userid22)) { $STKFF = $webrow['STKFF']; $BUYFF = $webrow['BUYFF']; $BUYMF = $webrow['BUYMF']; $COMMENT = $webrow['COMMENT']; $order = $webrow['ORDER']; } The odd thing is it works fine when i dont ask it to select "ORDER" here is a printscreen of the DB in phpmyadmin (attatched) If anyone knows what up please coment! All help is greatley appreciated!!!! [attachment deleted by admin]
  4. Thanks to everyone for the help i did try the $remaining tickets = $seatlimit - $tot['total_tickets']; but it didnt echo anything, and it didnt give me an error this is becuase i didt realise i put it AFTER the die() LOL I'm realy impressed by the help people give on thif fourm, and i plan to start giving advice when i get a bit better
  5. thanks again for the advice Rajiv i dont think ive got my head round these arrays yet how can i make a "remaining tickets" script this is what i have so far: echo 'remaining tickets= $tot['total_tickets'] - $seatlimit';
  6. can you also tell me how i can run the Die('sorry the performane is fully booked') command is the .$tot['total_tickets'] + $_POST[Tickets] > $seatlimit i have had a play but no hope thanks again chris
  7. oh mate thats fantastic thanks i would never have figured that out can you please expalin the whole ".$" thing whats the difference between a .$variable and a $variable?
  8. hi there i have been trying to figure this one out for hours but no hope basicly this code adds the input from a form to the drama departments DB, then checks the total number of tickets that have been booked the db input code is fine, its the total number code i cant get to work the code SHOULD go through the table and find all the rows containing the selected performance name (Test1 for example) in the performance colum then all the rows containing test1, the "tickets" colum will be added uthen it will be echoed out heres my code: <?php $Performancename = $_POST['Performance']; mysql_connect("localhost","dncwd_drama","*********"); mysql_select_db("dncwd_drama"); $sql="INSERT INTO bookings (Performance, Name, Email, Phone, Tickets) VALUES ('$_POST[Performance]','$_POST[Name]','$_POST[Email]','$_POST[Phone]','$_POST[Tickets]')"; if (!mysql_query($sql)) { die('Error: ' . mysql_error()); } else echo " <br> Tickets Reserved ! <br> you should recive a conformation email shortly, please print it and bring it with you <br>"; $query = "SELECT SUM(Tickets) FROM bookings WHERE Performance = '$Performancename'"; $result = mysql_query($query) or die(mysql_error()); // Print out result $tot = mysql_fetch_array($result); echo "Bookings = $tot"; echo "<br>"; ?> the problem is the output of the page is: thanks for all help guys [attachment deleted by admin]
  9. Thanks thats a good start, but how can i put these into a dropdown menu, like in a form <option>datesgohere</option> is as far as i got
  10. it will need to be in UK date format (DD/MM/YYYY) just to avoid confusion thanks again chris
  11. Hi there im working on a reservation system for a weekly club i have everything finished but the system requires the admin to add the date (eg. 09/12/2009) of every wednesday to a mysql table so that a drop down menu of wednesdays can be created on teh reservations page i have seen those little dropdown javascript callenders before but can someone please tell me if it is possible to make one that only displays wednesdays? thanks alot chris
×
×
  • 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.