DaiLaughing, etully,
absolute legends!!!
As we all know - there is something really satisfying when you solve your own problem with PHP.
Without both your 'nudges' in the right direction I would still be pulling my hair out!!! THANKYOU.
I appreciated the 'test' - no better way to learn!
Firstly - I had never heard of or used
print_r($_POST)
When I submitted that, I realised the output was an integer...
I decided to do it the 'proper' way - so set about figuring out how to select what I want from my DB using that unique integer (the ID).
I know you guys know how to do it - but for anyone else searching - here is how I did it:
(I renamed 'users' to 'row')
My Form:
$sql="SELECT id,gallerytitle FROM galleries ";
$result = mysql_query($sql);
?>
<form action="images_upload_single.php" method="POST">
<select name="row">
<option>Select Gallery...</option>
<?php
while($row = mysql_fetch_array($result))
{
echo "
<option value =\"".$row['id']."\">".$row['gallerytitle']."</option>
";
};
?>
</select>
<input type="Submit" value="Save">
</form>
When you hit 'Submit' it loads up "images_upload_single.php":
<?php
$selectgallery=$_POST['row'];
require_once("dbconnect.php"); // Include the file that connects to the database
$query = "SELECT id,gallerytitle FROM galleries WHERE id='$selectgallery'";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$galleryid = mysql_result ( $result, 0, "id" );
$gallerytitle = mysql_result ( $result, 0, "gallerytitle" );
echo $galleryid . $gallerytitle;
?>
This then successfully prints the selected items details from the table!
Thank you again!