Click to See Complete Forum and Search --> : mysql/windows problems


Anon
12-12-2001, 10:34 AM
Since I have no idea where to ask this, I'll ask it here.

I'm running windows 98 with pws as my server and mysql v3.23.42 and php 4.06, When I installed mysql and went to dos and typed "mysqld --standalone"

it gave me this

"Can't initialize Innodb as 'innodb_data_file_path' is not set.

but mysql did start.

Now, I try this,


$connection=mysql_connect("127.0.0.1","","") || die("Nope");

$result=mysql_query("SELECT * FROM pass where name='$username' && password='$password'");

/*line 8*/$test=mysql_num_rows($result);

it gives me

"Warning: Supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\test\run.php on line 8
"

Is it mysql or php or my logic, please help

Anon
12-12-2001, 05:30 PM
hey,

hopefully your prob could be solved, when you use instead :
/* your code
$connection=mysql_connect("127.0.0.1","","") || die("Nope");

$result=mysql_query("SELECT * FROM pass where name='$username' && password='$password'");
/*

this

$connection=mysql_connect("127.0.0.1","","") || die("Nope");

$sqlstatement="SELECT * FROM pass where name='$username' && password='$password'";

$result=mysql_query($sqlstatement, $connection);

regards
JR


Drake wrote:
-------------------------------
Since I have no idea where to ask this, I'll ask it here.

I'm running windows 98 with pws as my server and mysql v3.23.42 and php 4.06, When I installed mysql and went to dos and typed "mysqld --standalone"

it gave me this

"Can't initialize Innodb as 'innodb_data_file_path' is not set.

but mysql did start.

Now, I try this,


$connection=mysql_connect("127.0.0.1","","") || die("Nope");

$result=mysql_query("SELECT * FROM pass where name='$username' && password='$password'");

/*line 8*/$test=mysql_num_rows($result);

it gives me

"Warning: Supplied argument is not a valid MySQL result resource in C:\Inetpub\wwwroot\test\run.php on line 8
"

Is it mysql or php or my logic, please help

jrmad
12-13-2001, 05:14 PM
Hey Drake,

ok ... second try :)

this small script-peace shuold work properly.
<?php
$conn = @mysql_connect("127.0.0.1", "", "");
if($conn) {
mysql_select_db("NAME_OF_YOUR_DB", $conn);
}
else {
die("cant't get connection");
}
$sql = "SELECT * FROM pass where name='$username' && password='$password'";
$result= mysql_query($sql, $conn);
$test=mysql_num_rows($result);
echo $test;
?>

check this out...

abtw : you can use && or AND in your select-statements.

JR