473,766 Members | 2,060 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 1902
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
2899
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
1915
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
6867
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
2603
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
1409
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
22570
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
1629
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
1656
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
3936
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
9568
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
9404
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
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.