Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A couple of PhP errors
Old 11-30-2009, 12:27 PM A couple of PhP errors
Moritz's Avatar
Average Talker

Posts: 24
Name: Daniel Moritz
Location: Sweden
Trades: 0
Noob of the week is back

I launched a php scriot, and i got this:
Code:
Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a3540980/public_html/ucp2/inc/check.inc.php on line 88

Warning:  fread() [function.fread]: Length parameter must be greater than 0 in /home/a3540980/public_html/ucp2/header.php on line 42
Otherwise i can see the page.
Moritz is offline
Reply With Quote
View Public Profile Visit Moritz's homepage!
 
 
Register now for full access!
Old 11-30-2009, 01:18 PM Re: A couple of PhP errors
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Without seeing the code I can't tell you exactly what the problem is, but I can tell you what the messages mean:

The first warning (mysql_num_rows()) most likely means that a sql query failed. This may be syntax related or it could be a problem with the database.

The second warning (fread()) means that the second argument to fread is either 0 or a negative. Note that 0 == null == '' so if you have an unset variable as the length parameter you will get this message.

Post your code if you want a better answer.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-30-2009, 01:33 PM Re: A couple of PhP errors
Moritz's Avatar
Average Talker

Posts: 24
Name: Daniel Moritz
Location: Sweden
Trades: 0
For this error:
Code:
Warning:  fread() [function.fread]: Length parameter must be greater than 0 in /home/a3540980/public_html/ucp2/header.php on line 42
Code:
42.                $hostname      = fread($fp, $strlen);
The other error disappeared. And i know which .sql file im supose to execute, but when i do it it says that another file does already exist.

I dont know if im imoprting it right though :S

PhPMyAdmin:
Code:
Error

     SQL query:     
              --
-- Gegevens worden uitgevoerd voor tabel `backup`
--
 CREATE  TABLE  `useravatars` ( `id` int( 11  )  NOT  NULL  AUTO_INCREMENT  PRIMARY  KEY ,
 `Username` varchar( 30  )  NOT  NULL ,
 `picurl` TINYTEXT NOT  NULL ,
 `Description` TINYTEXT NOT  NULL 
);

     
      MySQL said:  
  #1050 - Table 'useravatars' already exists

Last edited by Moritz; 11-30-2009 at 01:36 PM..
Moritz is offline
Reply With Quote
View Public Profile Visit Moritz's homepage!
 
Old 12-01-2009, 05:03 AM Re: A couple of PhP errors
Super Talker

Posts: 139
Name: John Davis
Trades: 0
looks like $fp and $strlen equal to null.
can you show how you've assigned those variables?
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Reply     « Reply to A couple of PhP errors
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13589 seconds with 12 queries