0

this is 'pemaju_semakan2.php' coding

<?php include("db.php"); ?>

<?php
$IDSykt=$_POST['IDSykt'];

$query = "SELECT * FROM pemaju WHERE PJ_SYKT_NO='$IDSykt'";
$result=mysql_query($query);

while($row = mysql_fetch_array($result))
{
    $IDSykt=$row['PJ_SYKT_NO'];
    $NamaSykt=$row['PJ_SYKT_NAMA'];
}

this is 'db.php' coding

<?php
$hostname_connection = "localhost";
$database_connection = "zaza";
$username_connection = "root";
$password_connection = "";
$connection = mysql_pconnect($hostname_connection, $username_connection, $password_connection) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

and this is the error

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\pkpkr 09072010\pemaju_semakan2.php on line 9

I have this problen when i running in xamp.. But it was run succ in WAMP5.. is there anything error on my code or there have another setting in xampp?

Edited by Reverend Jim: Fixed formatting

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by pritaeas
0

1 <?php include("db.php"); ?>
2
3 <?php
4 $IDSykt=$_POST;
5
6 $query = "SELECT * FROM pemaju WHERE PJ_SYKT_NO='$IDSykt'";
7 $result=mysql_query($query);
8
9 while($row = mysql_fetch_array($result))
10 {
11 $IDSykt=$row;
12 $NamaSykt=$row;
13 }

0
$query = "SELECT * FROM pemaju WHERE PJ_SYKT_NO='$IDSykt'";
echo $query;
$result=mysql_query($query);

The above code echo your query in browser, copy and paste the result in phpadmin sql editor and check whether it returing rows.

0

According to the error message your query return false, which indicates failure. Are you sure you've copied your database and tables, and created the same user ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.