CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 PhpMyAdmin

Print topic Send  topic

Author Message
Help?
Posted: 08/26/2003, 7:44 PM

Hi, I was wonder if anyone here, have any experince in PhpMyAdmin?
I recently brought, a hosting which comes with PhpMyAdmin.
And I have uploaded all the files to my sever.
But I do not understand why my ftp never connect to my database.

http://www.abna.ca/VC/Login/login_form.html

Everytime I try to connect to my database, it says this.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site82/fst/var/www/html/VC/Login/checkuser.php on line 21

can anyone help

P.S I'm a total newbie, If you need anymore information jsut ask.
P.S again, Please and Thank You
RonB
Posted: 08/27/2003, 12:04 AM

Could you post line 21 of checkuser.php please.

Ron
DaveRexel
Posted: 08/27/2003, 12:15 PM

::

The URL throws a working login page and pressing submit throws the error

http://www.abna.ca/VC/Login/login_form.html

Try publishing one of CCS example projects in un-altered form to test folder on your site addressing un-altered example CCS Intranet & Internet databases. If you get the same error your hosting setup could be mis-configured but before this step please use very simple files to test the connectivity prior to attributing the failure to your host.

BTW what's phpMyAdmin go to do with this?

Dave
Help?
Posted: 08/27/2003, 1:21 PM

$login_check = mysql_num_rows($sql);

RonB: This is the line 12 on checkuser.php, if you want the whole file, just tell me ^-^

DaveRexel: Simple files to test my connections? Like what kind of simple files?
RonB
Posted: 08/27/2003, 2:17 PM

Hi,

It would be helpfull if you could post the complete checkuser.php file. The line you posted doesn't give much additional info. Is this a CC or CCS project?
I still have the feeling there is something wrong with the connection to the database. That's why it returns the error mesage.

Normaly you would have code looking somewhat like this:
$sSQL="select something from sometable";
$sResult= mysql_query($sSQL);

and then some code doing something with the resultset, for example:

while(list($ID,$lastname,$firstname)=mysql_fetch_row($sResult))

and then some action that does something usefull witg the resutling data.


So if you could post the complete checkuser file that might be helpfull.

Ron
Help?
Posted: 08/27/2003, 3:08 PM

Ahemm, does it have to be in CC or CCS?
cause i just found this off the net somewhere, and I do have CC it is just that i don't understand how to config the properties.

<?
/* Check User Script */
session_start(); // Start Session

include 'db.php';
// Conver to simple variables
$username = $_POST['username'];
$password = $_POST['password'];

if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'login_form.html';
exit();
}

// Convert password to md5 hash
$password = md5($password);

// check if the user info validates the db
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql);

if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('first_name');
$_SESSION['first_name'] = $first_name;
session_register('last_name');
$_SESSION['last_name'] = $last_name;
session_register('email_address');
$_SESSION['email_address'] = $email_address;
session_register('special_user');
$_SESSION['user_level'] = $user_level;

mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'");

header("Location: login_success.php");
}
} else {
echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br />
Please try again!<br />";
include 'login_form.html';
}
?>
RonB
Posted: 08/27/2003, 3:29 PM

I can see nothing wrong at the first glance. Did you edit the db.php file so the databse name,user and password are correct for your database?

Ron
Help?
Posted: 08/27/2003, 5:13 PM

$dbhost = ''; like the ip address of the site? 69.57.142.60 or DNS server?
$dbusername = ''; databsebase login name?
$dbpasswd = ''; database password?
$database_name = ''; And the database name.
RonB
Posted: 08/28/2003, 2:06 AM

"$dbhost = ''; like the ip address of the site? 69.57.142.60 or DNS server?"
Yes.


"$dbusername = ''; databsebase login name?"
Yes

"$dbpasswd = ''; database password?"
Yes

"$database_name = ''; And the database name."
Yes.

make sure those entries are correct for your enviroment and the script should work.

Ron
dope
Posted: 08/28/2003, 2:45 AM

try to do a $login_check = mysql_num_rows($sql) or die(mysql_error()); and see what the error is
Help?
Posted: 08/28/2003, 1:29 PM

Well, I double checked my password, username, database name, and they are right..
Ok, now after I putted $login_check = mysql_num_rows($sql) or die(mysql_error()); in, I tried to login, and it tells me this...

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site82/fst/var/www/html/VC/Login/checkuser.php on line 21
No Database Selected

No databse selected? So does it mean I have to put the database name in the checkusers.php file?
RonB
Posted: 08/29/2003, 4:05 AM

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site82/fst/var/www/html/VC/Login/checkuser.php on line 21
No Database Selected

check db.php and make sure the database_name is filled correctly. The error seems to inciate that no database name was provided.

Ron
Help?
Posted: 08/29/2003, 7:56 PM

I should have typed the database name rite..
can you please go to this URL and see which is the database name?

http://www.angelfire.com/alt2/hoshi/see.jpg
Help?
Posted: 08/29/2003, 7:57 PM

Oh, again about the http://www.easyphp.org/ program, i downloaded it, but all the faqs are in german, and I don't until understand to work it.
RonB
Posted: 08/30/2003, 4:36 PM

The database name is abna_ca

Ron

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.