Jump to content

pietbez

Members
  • Posts

    65
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

pietbez's Achievements

Member

Member (2/5)

0

Reputation

  1. thanks, got it
  2. can someone please point out where i m going wrong. this code is working fine, but i need the results in a variable $result = mysql_query("SELECT * FROM `gifts` WHERE `id` =$id "); while($row = mysql_fetch_array($result)) { echo $row['price'] , $row['units']; } so, when i do this, i only get the first variable??? $result = mysql_query("SELECT * FROM `gifts` WHERE `id` =$id "); while($row = mysql_fetch_array($result)) $price = $row['price']; $units = $row['units']; { echo $price , $units; } please help.
  3. sorry for that. that was a stupid mistake. cant believe i didnt pick that up. sometimes when you stare at the code to long you start missing things. thanks for that.
  4. here is the form with the radio buttons thanks <?php $id = $_REQUEST['id']; $guest = $_REQUEST['guest']; ?> <html> <head> <title>RSVP</title> <link rel='stylesheet' type='text/css' href='style.css' /> </head> <body style="body"> <ul id="nav"> <li><a href="home.php?id=<?php echo $id; ?>&guest=<?php echo $guest; ?>">invitation</a></li> <li><a href="rsvp.php?id=<?php echo $id; ?>&guest=<?php echo $guest; ?>">rsvp</a></li> <li><a href="menu.php?id=<?php echo $id; ?>&guest=<?php echo $guest; ?>">menu</a></li> <li><a href="sleep.php?id=<?php echo $id; ?>&guest=<?php echo $guest; ?>">sleep</a></li> <li><a href="gifts.php?id=<?php echo $id; ?>&guest=<?php echo $guest; ?>">gifts</a></li> </ul> <div id="rsvp-wrap"> <h2><?php echo $guest; ?></h2> <h2>Will you be joining us on our special day?</h2> <form method="post" action="rsvp_update.php"> <table> <input type="hidden" name="guest" value="<?php echo $guest; ?>"> <input type="hidden" name="id" value="<?php echo $id; ?>"> <input type="radio" name="attend" value="Yes"/>- Yes yes yes! cant wait<br><br> <input type="radio" name="attend" value="Maybe"/>- Too early to say, gotta check my diary. but pencil me in<br><br> <input type="radio" name="attend" value="sorry"/>- Would love to be there, but wont be able to make it. Let me buy you a present to make up for it<br><br> <input type="radio" name="attend" value="No"/>- No. not gonna bother. never realy liked you guys that much anyway<br><br><br> <input type="Submit" value="Submit" /> </table> </form> </div> </body> </html>
  5. pulling my hair out here, please help. why am i getting a "maybe!" result no matter what my radio box selection is. i know the variable gets passed to this php succesfully, i tested it with "echo $attend" then i get the right results but when i use this code, my result is always "maybe" Please hepl <?php $guest = $_REQUEST['guest']; $attend = $_REQUEST['attend']; $id = $_REQUEST['id']; include('include/connection.php'); $query="UPDATE data SET guest = '$guest', attend = '$attend' WHERE id = '$id'"; mysql_query($query) or die ('Error updating database'); if ($attend == "yes") { echo "yes!"; } else if ($attend == "no") { echo "no!"; } else { echo "maybe!"; } ?>
  6. Hi, i know this is probably very basic but i have been banging my head and looking for tuts. i have built a mysql php dropdown menu. all displays fine. now, how do i get the menu to actualy take me to a new url? the new url should be www.mysite.com/"menu selection" <? include_once 'includes/db.php'; $result = mysql_query("select * from crimerate WHERE DISTRICT = 'Limpopo'", $con); if (!$result) { die('Invalid query: ' . mysql_error()); } $options=""; while ($row=mysql_fetch_array($result)) { $id=$row["id"]; $crime=$row["CRIME"]; $options.="<OPTION VALUE=\"$id\">$crime</option>"; } ?> <SELECT NAME=crime> <OPTION VALUE=0>Choose <?=$options?> </SELECT>
  7. thank you so much, that is exactly what i was looking for you saved me alot of pain
  8. Hi, can anybody please tell me how i can make "Arson" into a php variable <script type="text/javascript" src="js/swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF( "open-flash-chart.swf", "my_chart", "550", "400", "9.0.0", "expressInstall.swf", {"data-file":"ofc-chart.php?crime=Arson"} ); </script>
×
×
  • 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.