473,589 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
16
Saved successfully
"

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

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

mysql_close($co nn);
?>
"

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>D ata Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1. </td><td align="left">Pr oduct
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">It em
Name</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="itemname" ></td></tr>
<tr><td align="left">3. </td><td
align="left">De scription</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="descripti on"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Pr ice</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="price"></td></tr>
<tr><td align="left">5. </td><td
align="left">In formation</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="informati on"></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 1889
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**********@y ahoo.com> wrote in message
news:bf******** ***@FreeBSD.csi e.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\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
16
Saved successfully
"

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

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

mysql_close($co nn);
?>
"

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>D ata Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1. </td><td align="left">Pr oduct
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">It em
Name</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="itemname" ></td></tr>
<tr><td align="left">3. </td><td
align="left">De scription</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="descripti on"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Pr ice</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="price"></td></tr>
<tr><td align="left">5. </td><td
align="left">In formation</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="informati on"></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**********@y ahoo.com> wrote in message
news:bf******** ***@FreeBSD.csi e.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\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: itemname in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: description in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: price in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
15

Notice: Undefined variable: information in
C:\Programme\Ap ache
Group\Apache2\h tdocs\amt\cgi\p roductsave.php on line
16
Saved successfully
"

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

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

mysql_close($co nn);
?>
"

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>D ata Entry - Product
List</u></b></center>
<br>
<table align="center" border="0">
<tr><td align="left">1. </td><td align="left">Pr oduct
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">It em
Name</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="itemname" ></td></tr>
<tr><td align="left">3. </td><td
align="left">De scription</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="descripti on"></td></tr>
<tr><td align="left" >4.</td><td
align="left">Pr ice</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="price"></td></tr>
<tr><td align="left">5. </td><td
align="left">In formation</td><td align="left">:</td>
<td align="left"><i nput type="text"
name="informati on"></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
2880
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 MySql folder on drive C. However, when I'm in Dreamweaver I click on Applications at the side, and the plus button to add a MySql database. It tells me to enter the
3
1905
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. I know windows/asp, etc. much more extensively. So, can I just move the whole thing over to a Windows server, upload the mysql backup database and change the settings for the db connection and have it work? Is there anything that would prevent...
4
6855
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 good one ? Do you know any good books that talks about C++ and MySQL ? Thank you
16
2576
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 gradual upgrade of my web programming skills from Classic ASP / VBS to ASP.NET / VB.NET. While the study of the language differences and all the new features in .NET has so far not been a traumatic experience, I am a bit shell-schocked after
0
1402
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 => /usr/lib/librt.so.1 libcrypt_i.so.1 => /usr/lib/libcrypt_i.so.1 libgen.so.1 => /usr/lib/libgen.so.1 libsocket.so.1 => /usr/lib/libsocket.so.1 libnsl.so.1 => /usr/lib/libnsl.so.1
4
22516
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 the table at the top of the table but the field names currently are 'field1' etc, so how do I rename the field names to the fields on the top row of the table. Cheers,
6
1621
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 cannot determine which sentence to use for this purpose, that can help me to display the information of the person who match with the search criteria. This is my actual Servlet. import java.io.IOException;
9
1649
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 the database each day. Every 3 months I have to archive some of the older detail rows to allow continued running of the application against the most current 90 day data. The users have decided to incorporate ALL of the data for their analysis. ...
6
3932
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
0
7931
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7865
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8233
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3849
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3889
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2374
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1461
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.