Whats wrong in dis code???

Started on the old forum in May 2010 · view the original in the archive · old links redirect here

2 replies · 336 views · started 16 years ago · 1 min read

2 participants
slowy Senior · 357 posts #1
<?php
include("conf.php");
include("func.php");
connect($dbserver,$dbname,$dbuser,$dbpass);
	$week_day 	= date("w");
	$today 		= date("Ymd");
	// Today 
	$week_day 	= date("w");
	$today 		= date("Ymd");
	// Today 
	$result 	= mysql_query("SELECT `ur` FROM `sites` WHERE `id`=$sid AND `date`=$today LIMIT 1;");
	$row 		= mysql_fetch_array($result);
	$host_today = $row['host'];
	//---------------------  --------------------------
	$result		= mysql_query("SELECT * FROM `sites` WHERE `ur` >= $host_today AND `date`=$today ORDER BY `host` DESC;");
	$top_place 	= mysql_num_rows($result);
	echo "<b>Place in Top:</b> \n";
	echo "<font color='red'>$top_place<br/></font>\n";
	?>

its giving error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xyz/public_html/adc.php on line 13

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/xyz/public_html/abc.php on line 17\

whats wrong??????

realcoder Junior · 17 posts #2

you might have mist spelt something in ur mysql_query check to see if the tables and row are created or spelt properly , have another look at the mysql query in abc.php

brandon rules the codeing industry

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close