Hi Guys/Girls,
I'm having a problem in where i've got an imagePath field in a table (all PHP MySQL) which is set to a generic value, i'm trying to test whether or not the value in the 'imagePath' field is the generic value or if it has been changed. It's basically so user can upload an image once, but if they try to upload their image again, it blocks them out and outputs a message "You have already added your image etc" But the MySQL select statement is only selecting some of the generic imagePath.
The default/gerneric image path in the database is 'images/playerprofileimages/none.gif' (so basically an image thay say's "their is no custom image that appears") when i echo the select statement results i only get 'images/playerprofileimages/' without the 'none.gif' on the end. Does anyone know why? Heres my code:
$pulledProfileCode = $_SESSION['sesProfileCode'];
$conn = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("playerprofiles", $conn) or die(mysql_error());
$pathResult = "select imagePath from profiledetails where profileCode = '$pulledProfileCode'";
$pathResult_res = mysql_result(mysql_query($pathResult), 0);
echo "<br><br>$pathResult_res<br><br>";
if($pathResult_res == "images/playerprofileimages/none.gif"){
echo "<form enctype=\"multipart/form-data\" action=\"uploader.php\" method=\"POST\">
<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"100000\" />
Send this file: <input name=\"userfile\" type=\"file\" />
<input type=\"submit\" value=\"Send File\" />
</form>";} else {
echo "You have already selected your image";
}
Sorry it's so long but i thought some background information on what the script is trying to achieve might help.
Thanks a million in advance,
Casey Gordon