954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

$rs=mysql_query($sql) or die("error in common.inc.php at line 257");

Hello please help

Total php beginner please help i am going crazy
my home-page opens finishes loading but with error's on page and my hitcounter does not display on my site but it's still logging my site

I looked through my site files and found this error below.
Is this the problem i hope please help me everything is so complex for me to understand alone: thanks so much

$sql="select * from links_location where location='l'";

$rs=mysql_query($sql) or die("error in common.inc.php at line 257");

while($rec=mysql_fetch_array($rs))


This is my hitcounter stat.php file
<?

include("include/common.inc.php");

global $Call;

switch($Call)

{

case"":

start_stats();

break;

case"show_pages":

show_pages();

break;

}

function start_stats()

{

global $load_url,$title,$current_sid,$REMOTE_ADDR,$ip_address,$resolution,$color_depth,$browser,$platform,$countryName,$visited_from,$member_id,$hit_counter,$done,$url;

$sqls="select counter from counter where member_id=$member_id";

$rss=mysql_query($sqls) or die("error");

if(mysql_numrows($rss)>0)

{

$recs=mysql_fetch_array($rss);

$hit_counter=$recs[0]+1;

}

else

{

$hit_counter=0;

}

if(empty($current_sid))

{

$sql="select * from counter where member_id=$member_id";

$rs=mysql_query($sql) or die("Unable to check the existence of member");

if(mysql_numrows($rs)>0)

{

$sql="Update counter set counter=counter+1 where member_id=$member_id";

mysql_query($sql) or die("Unable to update counter.");

}

else

{

$sql="insert into counter values($member_id,1)";

mysql_query($sql) or die("Unable to update counter.");

}

$ip_address=$REMOTE_ADDR;

$ip_address=$REMOTE_ADDR;

get_country();

$last_login=getmysqldate(getukdate(date("Y-m-j")));

$time=date("G:i:s");

$last_login=$last_login." ".$time;

$sql="insert into visitor_stats values('',$member_id,\"$ip_address\",\"$last_login\",\"$resolution\",\"$color_depth\",\"$browser\",\"$platform\",\"$visited_from\")";

mysql_query($sql) or die("Unable to make log of login .");

}

if(empty($current_sid))

{

$current_sid=session.session_id();

session_register("current_sid");

}

?>

<?

if(empty($done))

{

$done="no";

?>

<?

}

}

function show_pages()

{

global $HTTP_POST_VARS,$done,$url;

?>

<?

}

oracle4me
Newbie Poster
3 posts since Mar 2005
Reputation Points: 10
Solved Threads: 0
 

Please read and follow Paradox814's post at this thread:
http://www.daniweb.com/techtalkforums/thread25821.html

It will show you some basics of running mysql queries in PHP along with how to read the mysql errors. Use the techniques shown to modify how you run your queries. Create a page that only has the problem--nothing else. Keep the chunk you are working on as small as possible. When you get it working, add one step to it, and test again.

Enjoy the journey. :)

Troy
Posting Whiz
362 posts since Jun 2005
Reputation Points: 36
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You