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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.