Html Code:
[/code]
PHP Code:
<title>Sales REP Maintenance</title>
Successfully connected to MySQL.';//mysql_close (); Close the Connection}else {die ('Could not connect to MySQL because: '. Mysql_error (). '
');} if (@mysql_select_db ("PREMIERE", $connection)) {print 'The PREMIERE database has been selected.
';} else {die ('Cound not select the PREMIERE database because: '. Mysql_error (). '
');} if (!$_request[' submit ']) {generate_form ();} else if ($_request[' submit '] = = "Search") {Search_rep ();} else if ($_request[' submit '] = = "Add") {Add_rep ();} else if ($_request[' submit '] = = "Delete") {Delete_rep ();} else if ($_request[' submit '] = = "Update") {Update_rep ();} function Generate_form () {}function search_rep () {//Define the rep number php variable name$rep = $_post[' rep_num '];p rint " The rep num Chosen was $rep
";//Define The Query$query =" SELECT * from REP WHERE customer_num = ' $rep ' ";//Output The resulting query Tableif ($r = mysql_query ($query)) {while ($row = Mysql_fetch_array ($r)) {print "{$row [' Rep_num ']}
{$row [' last_name ']}
{$row [' first_name ']}
{$row [' STREET ']}
{$row [' City ']}
{$row [' state ']}
{$row [' ZIP ']}
{$row [' COMMISSION ']}
{$row [' Rate ']}
\ n ";}}} function Add_rep () {}function delete_rep () {}function update_rep () {}?>
You can connect to the MySQL server, but you cannot display the results ...
Reply to discussion (solution)
Error_reporting (E_all & ~e_notice);
Change for
Error_reporting (E_all);
I might have known.
Change the $row key to lowercase.
Error_reporting (E_all & ~e_notice);
Change for
Error_reporting (E_all);
I might have known.
Change the $row key to lowercase.
I tried, the error message is:
Undefined index:submit ... on line 28
Undefined Index:submit ... on line 33
The 28 line is if (!$_request[' submit ') accepts the data submitted by the form
But there's no control named submit in your form.
Upstairs positive solution, give type a submit input plus name=submit
The 28 line is if (!$_request[' submit ') accepts the data submitted by the form
But there's no control named submit in your form.
How do we change that?
HTML file:
Rep Num:
Wouldn't it be possible to set the input type to "submit"?
Add a hidden input
Will
Switch
In general, the input type is set to "submit" on it. But the value of the unnamed Commit button is not committed
However, in your application, it is the value of the Commit button to determine how to operate, so be sure to name
Will
Switch