runnerjp Posted November 17, 2006 Share Posted November 17, 2006 hey guys im gonna keep it simple and shortdone area where you creat a profile...works a treat sets it up greatthen it comes to when you have to change it as it does not work and i think its because i have missed somthing out in this code[code]<?php$table_name = "$tbl_profile";$connection = @mysql_connect("$db_host", "$db_user", "$db_pass") or die("Couldn't connect.");$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");$sql = "SELECT *FROM $table_nameWHERE profile_id = \"$profile\"";$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");$num=mysql_num_rows($result);while ($row = mysql_fetch_array($result)) {$profile_id = $row['profile_id'];$profile_url = $row['profile_url'];$template = $row['template'];$page_title = $row['page_title'];$template = $row['template'];$about_me = $row['about_me'];$hobbies = $row['hobbies'];$dob_mo = $row['dob_mo'];$dob_day = $row['dob_day'];$dob_yr = $row['dob_yr'];$rate = $row['rate'];$gender = $row['gender'];$eye_color = $row['eye_color'];$hair_color = $row['hair_color'];$height_ft = $row['height_ft'];$height_in = $row['height_in'];$build = $row['build'];?>[/code][b]EDIT BY Thorpe. If your going to use [ code ] tags please also use long <?php tags. This enable syntax highlighting.[/b] Link to comment https://forums.phpfreaks.com/topic/27638-wat-is-wrong-with-this/ Share on other sites More sharing options...
trq Posted November 17, 2006 Share Posted November 17, 2006 What do you expect to happen? Is this the entire script? Its doesn't really do anything.Where do you define $db_host, $db_user and $db_pass?$db_host, $db_user and $db_pass are variables and as such don't need to be contained within quotes.Where do you define $profile?Don't use @ while developing.You never check your query works before trung to use it.Your missing the closing } for the while(). Link to comment https://forums.phpfreaks.com/topic/27638-wat-is-wrong-with-this/#findComment-126401 Share on other sites More sharing options...
runnerjp Posted November 17, 2006 Author Share Posted November 17, 2006 Parse error: syntax error, unexpected $end, expecting ']' in /home/runnerse/public_html/profiles/users/include/editprofile.inc.php on line 111i keep getting codes like that that dnt make sence.... on line 111 i have this[code]<p>Welcome to the <?echo $sitename ?> Profile Editor <?echo "$auth[firstname]";?>!</p>[/code] Link to comment https://forums.phpfreaks.com/topic/27638-wat-is-wrong-with-this/#findComment-126415 Share on other sites More sharing options...
trq Posted November 17, 2006 Share Posted November 17, 2006 Variables do NOT need to be surrounded within quotes. Non numeric array indexes however do.[code=php:0]<p>Welcome to the <?php echo $sitename; ?> Profile Editor <?php echo $auth['firstname']; ?>!</p>[/code] Link to comment https://forums.phpfreaks.com/topic/27638-wat-is-wrong-with-this/#findComment-126428 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.