Jump to content

MyInvoice Php Script Problems


Silhouette

Recommended Posts

Hey All

 

I was wondering if someone might be able to help me out.

Im new to the whole php and mysql world so the problem may even be something im doing wrong.

 

I downloaded the MyInvoice Php billing script, made the necessary adjustments and uploaded the files. When i try run the script however i recieve the following:

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sc/public_html/billing/login.php on line 6

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/sc/public_html/billing/login.php on line 30

Warning: Cannot modify header information - headers already sent by (output started at /home/sc/public_html/billing/login.php:6) in /home/sc/public_html/billing/login.php on line 33

 

 

The coding for the login.php is this:

 

<?

include("inc/config.php");

$connection = mysql_connect($hostname, $user, $pass) or die ("Unable to connect!");

$query = "SELECT * FROM clients WHERE name = '$name' AND password = PASSWORD('$password')";

$result = mysql_db_query($database, $query, $connection);

if (mysql_num_rows($result) == 1)

{

session_start();

 

session_register("client_id");

session_register("client_name");

session_register("client_email");

session_register("client_ref");

session_register("client_title");

list($clientid, $name, $pass, $email, $ref, $title) = mysql_fetch_row($result);

$client_id = $clientid;

$client_name = $name;

$client_email = $email;

$client_ref = $ref;

$client_title = $title;

 

header("Location: menu.php");

mysql_free_result ($result);

 

mysql_close($connection);

}

else

 

{

mysql_free_result ($result);

mysql_close($connection);

 

header("Location: index.htm");

exit;

}

?>

Help would be much appreciated.

 

Thanx alot

Silhouette

Link to comment
https://forums.phpfreaks.com/topic/88179-myinvoice-php-script-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.