472,354 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

first time to use MySQL on MS Platform with PHP.

Dear my friends...

I am trying to develop a database application with PHP
Version 4.3.2, MS Window 2000, MySQL 4.0.13-nt and
Apache 2.

I tried to insert a record onto my MySQL but I got
this error messages. What do I have to defined to
overcome this problem?
"
Notice: Undefined variable: productid in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
16
Saved successfully
"

Here is the code of productsave.php :
"
<?php
include("functions.php");

$sql="
insert into product ( productid, itemname,
description, price, information )
values ('$productid', '$itemname', '$description',
'$price', '$information')
";
$conn=connection();
choosedb();
if (mysql_query($sql,$conn)){
echo "Saved successfully<br>";
}
else echo mysql_error();

mysql_close($conn);
?>
"

Here is the code of the form which calls
productsave.php (it's cgi program):
"
<form action="cgi/productsave.php" method="POST">
<center><b><u>Data Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1.</td><td align="left">Product
ID</td><td align="left" >:</td>
<td align="left" ><input type="text" name="productid"
readonly="yes"></td></tr>
<tr><td align="left">2.</td><td align="left">Item
Name</td><td align="left">:</td>
<td align="left"><input type="text"
name="itemname"></td></tr>
<tr><td align="left">3.</td><td
align="left">Description</td><td align="left">:</td>
<td align="left"><input type="text"
name="description"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Price</td><td align="left">:</td>
<td align="left"><input type="text"
name="price"></td></tr>
<tr><td align="left">5.</td><td
align="left">Information</td><td align="left">:</td>
<td align="left"><input type="text"
name="information"></td></tr>
<tr><td colspan="4" align="center"><input
type="submit" value="Save" src="img/ok.png">
<input type="reset" value="Clear"
src="img/no.png"></td></tr>
</table>
</form>
"

Please tell me. Thank you very much in advance.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
2 1835
Either use
extract ($_POST);
before your query or

use $_POST["productid"] to access the productid variable (and similar
construction for other varaibles POSTed from the form)

For further information:
http://uk.php.net/variables.external

"Prabu Subroto" <pr**********@yahoo.com> wrote in message
news:bf***********@FreeBSD.csie.NCTU.edu.tw...
Dear my friends...

I am trying to develop a database application with PHP
Version 4.3.2, MS Window 2000, MySQL 4.0.13-nt and
Apache 2.

I tried to insert a record onto my MySQL but I got
this error messages. What do I have to defined to
overcome this problem?
"
Notice: Undefined variable: productid in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
16
Saved successfully
"

Here is the code of productsave.php :
"
<?php
include("functions.php");

$sql="
insert into product ( productid, itemname,
description, price, information )
values ('$productid', '$itemname', '$description',
'$price', '$information')
";
$conn=connection();
choosedb();
if (mysql_query($sql,$conn)){
echo "Saved successfully<br>";
}
else echo mysql_error();

mysql_close($conn);
?>
"

Here is the code of the form which calls
productsave.php (it's cgi program):
"
<form action="cgi/productsave.php" method="POST">
<center><b><u>Data Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1.</td><td align="left">Product
ID</td><td align="left" >:</td>
<td align="left" ><input type="text" name="productid"
readonly="yes"></td></tr>
<tr><td align="left">2.</td><td align="left">Item
Name</td><td align="left">:</td>
<td align="left"><input type="text"
name="itemname"></td></tr>
<tr><td align="left">3.</td><td
align="left">Description</td><td align="left">:</td>
<td align="left"><input type="text"
name="description"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Price</td><td align="left">:</td>
<td align="left"><input type="text"
name="price"></td></tr>
<tr><td align="left">5.</td><td
align="left">Information</td><td align="left">:</td>
<td align="left"><input type="text"
name="information"></td></tr>
<tr><td colspan="4" align="center"><input
type="submit" value="Save" src="img/ok.png">
<input type="reset" value="Clear"
src="img/no.png"></td></tr>
</table>
</form>
"

Please tell me. Thank you very much in advance.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #2
Either use
extract ($_POST);
before your query or

use $_POST["productid"] to access the productid variable (and similar
construction for other varaibles POSTed from the form)

For further information:
http://uk.php.net/variables.external

"Prabu Subroto" <pr**********@yahoo.com> wrote in message
news:bf***********@FreeBSD.csie.NCTU.edu.tw...
Dear my friends...

I am trying to develop a database application with PHP
Version 4.3.2, MS Window 2000, MySQL 4.0.13-nt and
Apache 2.

I tried to insert a record onto my MySQL but I got
this error messages. What do I have to defined to
overcome this problem?
"
Notice: Undefined variable: productid in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Apache
Group\Apache2\htdocs\amt\cgi\productsave.php on line
16
Saved successfully
"

Here is the code of productsave.php :
"
<?php
include("functions.php");

$sql="
insert into product ( productid, itemname,
description, price, information )
values ('$productid', '$itemname', '$description',
'$price', '$information')
";
$conn=connection();
choosedb();
if (mysql_query($sql,$conn)){
echo "Saved successfully<br>";
}
else echo mysql_error();

mysql_close($conn);
?>
"

Here is the code of the form which calls
productsave.php (it's cgi program):
"
<form action="cgi/productsave.php" method="POST">
<center><b><u>Data Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1.</td><td align="left">Product
ID</td><td align="left" >:</td>
<td align="left" ><input type="text" name="productid"
readonly="yes"></td></tr>
<tr><td align="left">2.</td><td align="left">Item
Name</td><td align="left">:</td>
<td align="left"><input type="text"
name="itemname"></td></tr>
<tr><td align="left">3.</td><td
align="left">Description</td><td align="left">:</td>
<td align="left"><input type="text"
name="description"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Price</td><td align="left">:</td>
<td align="left"><input type="text"
name="price"></td></tr>
<tr><td align="left">5.</td><td
align="left">Information</td><td align="left">:</td>
<td align="left"><input type="text"
name="information"></td></tr>
<tr><td colspan="4" align="center"><input
type="submit" value="Save" src="img/ok.png">
<input type="reset" value="Clear"
src="img/no.png"></td></tr>
</table>
</form>
"

Please tell me. Thank you very much in advance.

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the...
3
by: Abby | last post by:
I have an application that is written in php/mysql on a Linux platform and need to transfer hosts. This is a session based application and I don't know a lot about php/Linux/mysql, but can get by....
4
by: Ben | last post by:
Hi I am new to C++ and I want to know if C++ is suitable for making a GUI application with a MySQL database. I also want to know what keywords in books I should look for. Is DATA STRUCTURES a...
16
by: TB | last post by:
Hi all: If you think that the following comments are absolute amateurish, then please bear with me, or simply skip this thread. A couple of months back I made the decision to initiate a...
0
by: Dragonphoenix | last post by:
bash-2.05b# ldd mysql libcurses.so.1 => /usr/lib/libcurses.so.1 libmysqlclient.so.12 => /sandbox/mysql-4.0.21/lib/mysql/libmysqlclient.so.12 libz.so.1 => /usr/lib/libz.so.1 librt.so.1...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
6
by: IvanJ2EE | last post by:
Hello partners. I have an issue using jdbc and a DB in MySQL. The problem is that I want to make a seach using the Last Name of a person stored in a MySQL DB, from a JSP The problem is that I...
9
by: Algonquin J. Calhoun | last post by:
I've developed an application that exceeds the Access 2GB limit. This application was developed as a prototype and the users have found it very useful. Approximately 45,000 records are added to...
6
by: Geoff Cox | last post by:
Hello, at the moment I can add the combined date and time into MySQL using php $dt1 = date("Y-m-d H:i:s"); is it possible to add the date and time separately? I thought it might be
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.