Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Linux, Apache, MySQL > MySQL Help

MySQL Help Post any question relating to MySQL here and hopefully someone can help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2004-06-25, 11:15 PM
Thesource
Guest
 
Posts: n/a
Default

Ok... he is the problem, I hoper I can be clear about it...

I was runing windows 2000 Pro, I had installed Apache2/PHP/Mysql and everything worked fine, I then began to program a game.... then like an idiot, I decided why not switch to WIN XP.. so I did a fresh install.... after the install I tried to re-install and setup the server items... but now I get this error when I try to test my gaem, which I have not edited in ayway since before the XP install....



Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in L:\Sites\game\chat2.php on line 6


anyhelp would be greatly appreciated...

You can contact me on AIM(RezinGuitaristFG) YIM(kronikentertainment) or MSN(SSJ4Goku_elite@hotmail.com)
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2004-06-25, 11:47 PM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

Posting the code on that line and the line that created the MySQL result would be helpful.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
  #3 (permalink)  
Old 2004-06-26, 12:17 AM
TheSource
Guest
 
Posts: n/a
Default

Alright, here is the entire section of code for that error, though now, all of the scripts I have, that did work, have similar errors... so I think i've done something with the installation, rather than the code, because I havent edited the actual in any way.

session_start();
include 'mysql_connect.php';
$username = $_POST['username'];
$password = $_POST['password'];
$sql = mysql_query("SELECT * FROM user WHERE username='$username' AND password='$password'");
$login_check = mysql_num_rows($sql);

if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
session_register('username');
$_SESSION['username'] =$username;
session_register('user_id');
$_SESSION['user_id'] = $user_id;
$log = "UPDATE user SET loggedin='yes' WHERE (username='$username')";
mysql_query($log);

include 'logfresh.php';
}
}
Reply With Quote
  #4 (permalink)  
Old 2004-06-26, 12:18 AM
TheSource
Guest
 
Posts: n/a
Default

Err.. *the actual code

Sorry for the double post.
Reply With Quote
  #5 (permalink)  
Old 2004-06-27, 03:58 AM
Moderator
 
Join Date: May 2004
Location: Portugal
Posts: 143
gesf is an unknown quantity at this point
Send a message via ICQ to gesf Send a message via MSN to gesf Send a message via Skype™ to gesf
Default

I don´t see any mysql_fetch_row() function in the code!
Is that the chat2.php file´s code !?
__________________
Best Regards,
Gonçalo "GesF" Fontoura

Website : gesf.org
Reply With Quote
  #6 (permalink)  
Old 2004-06-27, 08:47 AM
Xnuiem's Avatar
Senior Member
 
Join Date: May 2004
Location: DFW, Texas
Posts: 1,104
Xnuiem will become famous soon enough
Send a message via Yahoo to Xnuiem
Default

A good way to find out MySQL issues is to die with error.

Example:

For every result/query set, use "or die(mysql_error())" at the end.

Ergo, $sql = mysql_query("select * from users) or die(mysql_error());

This way it will die and print the error.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.