kpetsche20 Posted April 8, 2008 Share Posted April 8, 2008 I'm having trouble getting an image to display. it is setup to select the location from mysql. <td width="625" valign="top" class="mainbody"> <div class="welcometo">My Account </div> <p>Keeping your account information up-to-date is very important. Remember to make changes when they are needed.</p> <p> </p> <? $sql = "SELECT * FROM users WHERE login='".$_SESSION['login']."'"; $result = mysql_query($sql); $data = mysql_fetch_array($result); echo "<img src='profile/resize_image.php?file=".$data['picture']."&w=120&h=100&id=".$_SESSION['login']."' name='profpic' />"; if (isset($_POST['updatememberbt'])) { if ($_POST['firstname'] != '' AND $_POST['lastname'] != '' AND $_POST['email'] != '') { if (mysql_query("UPDATE users SET `firstname` = '".$_POST['firstname']."', `lastname` = '".$_POST['lastname']."', `email`= '".$_POST['email']."', `country`= '".$_POST['country']."', `squestion` = '".$_POST['squestion']."' , `answer` = '". $_POST['answer'] ."', `picture` = '".$_FILES['file']['name']."',`gender`= '".$_POST['gender']."', `phonenum`='".$_POST['phonenum']."' WHERE `login`= '".$_SESSION['login']."'")) {echo "your account was successfully updated <br /><br />"; if ($_FILES['file'] != ''){ $target = "/home/isearch/public_html/scriptlance/images/userimages/"; $target .= $data['login']."/"; $target2 = $target.$_FILES['file']['name']; $ok=1; $new=move_uploaded_file($_FILES['file']['tmp_name'], $target2); if($new) { echo "The file ". basename( $_FILES['file']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; echo $_FILES['file']['error'];} } } else echo "your account was not successfully updated <br /><br />"; } if ($_POST['oldpassword'] != '') { if (md5($_POST['oldpassword']) == $_POST['oldpasswordmd5']) { if ($_POST['newpassword'] != '' AND $_POST['newpassword2'] != '') { if ($_POST['newpassword'] == $_POST['newpassword2']) { if (mysql_query("UPDATE users SET `password` = '".md5($_POST['newpassword'])."' WHERE `login`= '".$_SESSION['login']."'")) echo "your password was updated <br /><br />"; else echo "your password was not updated <br /><br />"; } else echo "password do not match! your password was not updated <br /><br />"; } } else echo "please make sure to enter your exact current password in the Old password field <br /> "; } } ?> Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 8, 2008 Share Posted April 8, 2008 1.) Can you define 'having trouble'? What happens? What is displayed? 2.) Whenever your having troubles with something that is possibly related to mysql, add an or die statement: $result = mysql_query($sql) or die(mysql_error().'<br />With query:'.$sql); Quote Link to comment Share on other sites More sharing options...
kpetsche20 Posted April 8, 2008 Author Share Posted April 8, 2008 no image is dispalyed. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 8, 2008 Share Posted April 8, 2008 Do you get anything displayed? A box with a red cross in it? Quote Link to comment Share on other sites More sharing options...
kpetsche20 Posted April 8, 2008 Author Share Posted April 8, 2008 a box does display but there is no red x. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.