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. 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.
  2. 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.
  3. 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>
  4. 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!"; } ?>
  5. 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>
  6. thank you so much, that is exactly what i was looking for you saved me alot of pain
  7. 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>
  8. thanks, its perfect, slowly i learn
  9. no, thanks, its working fine, it was just in responce to your question about <span> the first link in the menu is active by default <li id="current"><a href="#"><span><?php echo $but1['title'];?></span></a></li> <li><a href="#"><span><?php echo $but2['title'];?></span></a></li> <li><a href="#"><span><?php echo $but3['title'];?></span></a></li> <li><a href="#"><span><?php echo $but4['title'];?></span></a></li> does that have anything to do with <span>?
  10. oops sorry, <li id="current"><a href="#"><span><?php echo $but1['title'];?></span></a></li> <li><a href="#"><span><?php echo $but2['title'];?></span></a></li> <li><a href="#"><span><?php echo $but3['title'];?></span></a></li> <li><a href="#"><span><?php echo $but4['title'];?></span></a></li> http://76.162.122.173/mygreenclean/index.php here you can see what im atempting to do
  11. i know this might sound like a stupid question to all you pros, but to me this is a mountain ??? what would be the sensible way to code this? <?php include('qazwsxedc/config.php'); mysql_connect($server,$username,$password); @mysql_select_db($database) or die ("Unable to connect to the database"); $button1 = mysql_query("SELECT title FROM menu where id=1"); $but1 = mysql_fetch_array( $button1 ); $button2 = mysql_query("SELECT title FROM menu where id=2"); $but2 = mysql_fetch_array( $button2 ); $button3 = mysql_query("SELECT title FROM menu where id=3"); $but3 = mysql_fetch_array( $button3 ); $button4 = mysql_query("SELECT title FROM menu where id=4"); $but4 = mysql_fetch_array( $button4 ); ?> <li><a href="#"><span><?php echo $but1['title'];?></span></a></li> <li><a href="#"><span><?php echo $but2['title'];?></span></a></li> <li><a href="#"><span><?php echo $but3['title'];?></span></a></li> <li><a href="#"><span><?php echo $but4['title'];?></span></a></li>
  12. i tried this, but no luck. still getting the same results. any other ideas?
  13. yes, thanks for all the help. my php and flash is now getting along like a house on fire (with a few modifications from my side .)
  14. im sorry if you feel my post does not belong here, but i am keen to learn php. all my background is flash actionscript. and yes i did try to modify it for my needs. you have to remember, what looks obvious to an expert can be a mountain for a noob
×
×
  • 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.