Jump to content

estonham

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

estonham's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. should I be creating a join...I am still learning. and finding it very steep at the moment.... cheers Edd
  2. at the moment I have got my product field semi working however it updates the product name but does not select it when going to edit the record. functions.php code [code]/* SelectProducts() */ function SelectProducts($selected = "", $i = "") {   //write the query to pull all the images   $sql = "SELECT * FROM products";   //perform the query   $result = mysql_query($sql);   //if it doesn't work..   if(!$result) {     echo('Error retrieving data from db ' . mysql_error());   }   //initialise $writeoption   $writeoption = "";   //start the select statement   $startselect = '<select name="product_name' . $i . '"><option value=""></option>';   //put the results into an array   while($row = mysql_fetch_array($result)) {   $count = mysql_num_rows($result);              $pid             = $row['idp'];         $selectProducts  = $row['product_name'];     //display     $writeoption .= ( '<option value="' . $pid . '" ' . (($pid == $selected ) ? 'selected="selected"' : '') . '>' . $selectProducts . '</option>');   } //close the while loop   //end select   $endselect = '</select>';   return($startselect . $writeoption . $endselect); } ?>[/code] Called from edit.php using this code functions.php is called by the file. [code] <?php echo SelectProducts(product_name); ?> [/code] Regards
  3. Maybe I was not very clear. [u]Table User_detail[/u] id(autoInc), username, password, address1, address2, zip, country(id from country table), email, phone. [u]Table country[/u] id(auto inc), country ___________________________ User needs to update record and this need to pull the country data and then update if userchanges it. This should be a pull down menu. I can get some of it working but feel an easier way of doing it maybe out there. So the User picks update details. Form shows all fields that had been filled in before. User updates them and presses submit. Any Ideas. Getting a little lost in php/mysql today. Cannot see wood for the trees. regards E
  4. I have a registrations form that selects a field from a 2nd table. User table has a field called country in it. The data is selected from the "id" field of the country table and posted to the user table's "country" field. Country table has 2 fields id and country_id this all works howver....I now need for the client/user to update details one of which may be the country field in his/hers user information. I cannot get his field to work as it needs to pull the country name from the coutry table..to give the name correctly... also it need to have the pull down menu still so the user can reselect a new country if needed. Can anyone help....I have be rying things for hours. Regards E
×
×
  • 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.