473,394 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

PHP form question

I was wondering if there was an easy way to show information in a form? I've
tried a variety of things, and I'm sure I'm doing something wrong, or just
don't know what I'm doing.. :) could be both! Anyway basically I want to be
able to edit information from a mysql db, but when they go to the edit page
I want the form that I need to edit to show the information from mysql in
the form itself.. One of the examples I have tried is:
$query = mysql_query("SELECT * FROM itltest WHERE jobnum='$jobnum' AND
custID='$custID'") or die (mysql_error());
while ($row = mysql_fetch_assoc($query)) {

?>

<input name="company" type="text" id="company" value="<? echo "$company"?>">

Thanks in advance!

Jul 17 '05 #1
4 1764
ph*********@comcast.net wrote:
I was wondering if there was an easy way to show information in a form? I've
tried a variety of things, and I'm sure I'm doing something wrong, or just
don't know what I'm doing.. :) could be both! Anyway basically I want to be
able to edit information from a mysql db, but when they go to the edit page
I want the form that I need to edit to show the information from mysql in
the form itself.. One of the examples I have tried is:
$query = mysql_query("SELECT * FROM itltest WHERE jobnum='$jobnum' AND
custID='$custID'") or die (mysql_error());
while ($row = mysql_fetch_assoc($query)) {
ADD THIS HERE:
$company = $row['company'];


?>

<input name="company" type="text" id="company" value="<? echo "$company"?>">

Thanks in advance!

Jul 17 '05 #2
.oO(ph*********@comcast.net)
$query = mysql_query("SELECT * FROM itltest WHERE jobnum='$jobnum' AND
custID='$custID'") or die (mysql_error());
while ($row = mysql_fetch_assoc($query)) {


Are $jobnum and $custID numeric? If yes remove the single-quotes around
them. Only strings have to be quoted.

Micha
Jul 17 '05 #3
Michael Fesser wrote:
$query = mysql_query("SELECT * FROM itltest WHERE jobnum='$jobnum' AND
custID='$custID'") or die (mysql_error());
while ($row = mysql_fetch_assoc($query)) {


Are $jobnum and $custID numeric? If yes remove the single-quotes around
them. Only strings have to be quoted.


Query will work with quotes round numbers - but MySQL may have problems
optimising the query.

C.
Jul 17 '05 #4
Sometimes i feel so dumb.. :) Thanks so much, this worked perfectly! you rock... :)

Mikey P
"jrf[no]" <"jrf[no]"@[spam]jokeaday.net> wrote in message news:<41***********************@news.wanadoo.nl>.. .
ph*********@comcast.net wrote:
I was wondering if there was an easy way to show information in a form? I've
tried a variety of things, and I'm sure I'm doing something wrong, or just
don't know what I'm doing.. :) could be both! Anyway basically I want to be
able to edit information from a mysql db, but when they go to the edit page
I want the form that I need to edit to show the information from mysql in
the form itself.. One of the examples I have tried is:
$query = mysql_query("SELECT * FROM itltest WHERE jobnum='$jobnum' AND
custID='$custID'") or die (mysql_error());
while ($row = mysql_fetch_assoc($query)) {


ADD THIS HERE:
$company = $row['company'];


?>

<input name="company" type="text" id="company" value="<? echo "$company"?>">

Thanks in advance!

Jul 17 '05 #5

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

Similar topics

16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
15
by: http://www.visual-basic-data-mining.net/forum | last post by:
Does anyone have any idea how to transferring data from TextBox1 in form1 to textBox2 in form2..... That means after i fill in any data in textBox1 and click Next button... It will bring me to...
3
by: Kaur | last post by:
Hi, I would appriceate any help to correct the code error that I am getting for the onclick event of a cmd button. I have two forms. Main Form "frmQuestion" and form 2 "SfrmQuestion"....
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
1
by: MrHelpMe | last post by:
Hello experts, I need a hand. On my asp submit page I have the following code: for i = 1 to 5 ' 5 question form' Question = Request.Form("Q" & i) Answer = Request.Form("A" & i) Comment ...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
6
by: smk17 | last post by:
I've spent the last few minutes searching for this question and I found an answer, but it wasn't quite what the client wanted. I have a simple online form where the user needs to fill out five...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...

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.