Jump to content

SamCec

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by SamCec

  1. KickStart and PFMaBiSmAd: Sorry for the delay in getting back to you, I had to go out. Thank you so much for the corrected code and the explanation. Your code did the trick. I now have the items in alphabetic order. Thanks Again, Sam
  2. It's going to take me some time to figure how to do what your asking. I am aware that "objectname" is populated. There is a record for each object. The objects are: Bunny, Butterfly, Cardinal, etc. You can see all of the objects by going to: www.woodartbysam.com/test If you go there, please keep in mind there is still a lot of work to be done on the site. Sam
  3. Folks: let me re-explain: Someone else wrote this for me because I DON'T KNOW php. Here are the 1st 28 lines of the app. PLEASE SEE MY COMMENTS AFTER THIS CODE. <?php include('connect/connect.php'); mysql_select_db($database) or die ("Unable to Connect to the database"); $woods = array(); $selectWood = "SELECT * FROM `wood`"; $queryWood = mysql_query($selectWood) or die(mysql_error()); while($item = mysql_fetch_array($queryWood)) { $woods[$item['index']] = array($item['name'], $item['photo']); } $objects = array(); $selectObjects = "SELECT * FROM `objecten` ORDER BY ".$item['objectName']." "; $queryObjects = mysql_query($selectObjects) or die(mysql_error()." $selectObjects"); while($item = mysql_fetch_array($queryObjects)) { array_push($objects, array( $item['objectName'], split(";", $item['photos']), $item['price'], $item['base'], $item['centerPiece'], $item['name'], $item['wood'])); } without the ORDER BY clause the code works fine. I know a little SQL so I originally added the "order by". When it didn't work, that's when I came for help. Sam
  4. KickStart: Here is the error I received after changing the "die" clause: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SELECT * FROM `objecten` ORDER BY
  5. chintansshah: Your code gave me the following error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" Sam
  6. Thanks for the suggestion but I pasted the code you supplied in my application and got this error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" Sam
  7. Hi: I'm new to PHP and Mysql. Wondering if you can help? This code works without the "order by" clause but with it, I get a parsing error. I do want the records sorted by "objectname", I also tried "ordered by $item['objectName']". That didn't work either. I got the same error. $selectObjects = "SELECT * FROM `objecten` [color=red]ORDER BY $item['objectName']";[/color] $queryObjects = mysql_query($selectObjects) or die(mysql_error()); while($item = mysql_fetch_array($queryObjects)) { array_push($objects, array( $item['objectName'], split(";", $item['photos']), $item['price'], $item['base'], $item['centerPiece'], $item['name'], $item['wood'])); }
  8. On an HTML Form, I have several Text boxes called "base1, base2...base13" Another text box I have is called "base_quantity" In my PHP routine: This is part of my code: $selected_base = $_POST['base1']; if ($selected_base == 'yes') { $base_value = $base_value + 1; $base_status = 'Yes'; } else if ($selected_base == 'no') { $base_value = $base_value - 1; $base_status = 'No'; } Later on in the PHP routine I want to pass back to the Form the value of $base_status and place it in the "base_quantity" text box. Something like this: base_quantity = $base_value. Can someone tell me how information is passed back to the FORM. Thank You, Sam
×
×
  • 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.