473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Im Having Trouble With A MySpace Clone Script

Error on the Home Page Above The Header:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 42

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 50

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/k/e/skeem/html/space4me/functions.php:42) in /home/content/s/k/e/skeem/html/space4me/index.php on line 73

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 76

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 77
Here is the error before the footer:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 130

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/s/k/e/skeem/html/space4me/functions.php on line 131

Here is the code they refer to, it seems to be the same call or function for each error:

This is lines 38 to 50
[PHP]
function sql_execute($sql_query,$wtr){
global $conn_id;
$sql_res=mysql_query($sql_query,$conn_id);
if($wtr=='get'){
if(mysql_num_rows($sql_res)){ <====PROBLEM LINE
return mysql_fetch_object($sql_res);
}
else {
return '';
}
}
elseif($wtr=='num'){
return mysql_num_rows($sql_res); <====PROBLEM LINE
[/PHP]

Here are lines 72 to 78:

[PHP]$sql="select * from banners where b_blk='N' and b_typ='H' and b_exp='N'";
$res=mysql_query($sql); <====PROBLEM LINE
$dis=array();
$dis_id=array();
$num=mysql_num_rows($res); <=====PROBLEM LINE
if(mysql_num_rows($res)) { <=====PROBLEM LINE
while($row=mysql_fetch_object($res)) {

Here are lines 130 and 131:

$num=mysql_num_rows($res);
if(mysql_num_rows($res)) {[/PHP]


To me it seems to be the same problem over and over again, but Im new to all of this. Any help would be appreciated.

Thanks in advance.
Matt
Nov 11 '08 #1
1 1635
mwasif
802 Expert 512MB
Make sure the query is valid and running properly
Expand|Select|Wrap|Line Numbers
  1. select * from banners where b_blk='N' and b_typ='H' and b_exp='N'
Use mysql_error() to know the error if any in this way
[PHP]$res=mysql_query($sql) or die("Error in query: ". mysql_error());[/PHP]
Nov 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: PD | last post by:
Hello everyone, I had posted a question regarding how to design high traffic fast dating website on different PHP groups. I got a lot of useful responses. I have added links to all the posts...
2
by: tony | last post by:
I am trying to use a form with a button that calls a verification script but can't seem to get the script to run at all - can anyone tell me if this SHOULD work in a forms onCLick or have I got the...
1
by: jaktharkhan | last post by:
Hi, I really really need help in trying to figure out how can I do a CloneNode on an Iframe where the cloned IFRAME clones with all its contents?. Basically what I am doing is dynamically building...
0
markmcgookin
by: markmcgookin | last post by:
Hi Folks, First off, Happy New year to all! This is a bit of a strange question, now I am a fairly accomplished .asp and .html web developer, and very computer literate, and I have recently...
7
by: webgyrl | last post by:
Hi, I am helping a musician friend of mine with his profile and I found a cool layout on Nas' MySpace page. I changed some things and re-did the graphics and I basically popped my Image URLS...
2
by: growlme | last post by:
Hey People.. I am trying to incorporate a list rollover into a myspace profile.. I know.. myspace.. my apologies but i've been asked to do it. The problem is this.. to have an image appear at...
1
by: ced69 | last post by:
having trouble getting marquee to work get object required errors tring t <title>This Month at the Chamberlain Civic Center</title> <link href="styles.css" rel="stylesheet"...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.