Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't see the wood for the trees

Status
Not open for further replies.

Elmserv

Programmer
Sep 25, 2004
72
GB
I am getting this error message

Notice: Undefined index: invno in /home/clients/rcldev/html/rlt/invoicecreate.php on line 97


From this chunk of code

Code:
// get next invoice no
$query = "select max(invno) from sledger where cno = $mast_cno";

$mysql = conectmysql();

$res = mysql_query($query,$mysql);
	// test for sucess
if (mysql_errno() >0)
	{die( mysql_error($mysql));}	

	if (mysql_numrows($res) == 0 )
		{$invno = 99;}
	else
		{
			$row = mysql_fetch_array($res, MYSQL_ASSOC);
L97 ->			$invno = $row['invno'];
		}
$invno++;

invno is an integer field with a width of 7

Richard
 
change this line as follows

Code:
$query = "select max(invno) [b]as invno[/b] from sledger where cno = $mast_cno";
 
Brilliant

Thanks very much, I looked at that for days. It will be a long time before I forget that lesson


Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top