Jump to content

wat is wrong with this :(


runnerjp

Recommended Posts

hey guys im gonna keep it simple and short
done area where you creat a profile...works a treat sets it up great
then 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_name
WHERE 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

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().
Parse error: syntax error, unexpected $end, expecting ']' in /home/runnerse/public_html/profiles/users/include/editprofile.inc.php on line 111

i 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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.