...

View Full Version : do I got the wrong idea??



rayzun
07-10-2005, 11:21 PM
if inside if
Parse error: parse error, unexpected T_ELSE

if ($determin)
{

$query = "SELECT * FROM `JS` WHERE `wrdprc` LIKE `$mkrs`";
$good_query=mysql_query($query);
if (mysql_num_rows($good_query) == 0)
{ { $query = "SELECT * FROM `JS` WHERE `wrdprc` LIKE `m` LIMIT 0"; }
else
{ $query = "INSERT INTO `JS` ( `id` , `wrdprc` , `wrdnprc` , `pgld` ) VALUES ( '', '$mkrs', '', '0' )";
$exec = mysql_query($query) or die (""); } }

}

Taylor_1978
07-10-2005, 11:32 PM
Your script is badly aligned.. It's easier to keep track of your script to see any faults if written in a building format: eg.



if ($determin) {

$query = "SELECT * FROM `JS` WHERE `wrdprc` LIKE `$mkrs`";
$good_query=mysql_query($query);

if (mysql_num_rows($good_query) == 0) {

$query = "SELECT * FROM `JS` WHERE `wrdprc` LIKE `m` LIMIT 0";

} else {

$query = "INSERT INTO `JS` ( `id` , `wrdprc` , `wrdnprc` , `pgld` ) VALUES ( '', '$mkrs', '', '0' )";
$exec = mysql_query($query) or die ("");

}

}


What I just put here is the correct script also.. you had too many { } around the line: $query = "SELECT * FROM `JS` WHERE `wrdprc` LIKE `m` LIMIT 0";

rayzun
07-11-2005, 12:22 AM
thanks, I will keep that thought
Im using code together from other projects

Iam getting the error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

mysql_num_rows():
is used on my server in different pages what could this be?

Nightfire
07-11-2005, 12:46 AM
Usually get that error if there's no results found, or an error in your query.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum