473,388 Members | 1,207 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,388 software developers and data experts.

adding to form?

novice with mysql so be slow.

Want to be able to update the contents of a database row through a
form, i want to be able to load the contents of a specific row

my database table is as follows

id(pk) | title | body | date(text field)
---------------------------------------------------------------------------
1 | hello | test | 15-11-2006 13:44
2 | again | test2 | 15-11-2006 13:45
basically i want to be able to add the contents of one of thw rows into
various forms, for instance lets say i want to edit all of the stuff in
the table which i do, and i want to add the title and the body into
forms respectively named title and body how would i do this?

I tried using a select statement to select all of the items from the
table in the database and put where id='".$id."'
Basically i dont have a clue wehre to start here so can someone please
help me

Nov 15 '06 #1
4 1293
Christo wrote:
novice with mysql so be slow.
....
I tried using a select statement to select all of the items from the
table in the database and put where id='".$id."'
Basically i dont have a clue wehre to start here so can someone please
help me
Okay, at this point you need to start with:
http://www.google.com/search?hl=en&q...=Google+Search

/m
Nov 15 '06 #2
Marcin Dobrucki wrote:
Okay, at this point you need to start with:
http://www.google.com/search?hl=en&q...=Google+Search
................................^^^^^^

Do you think searching in French (or Portuguese, or Chinese, ...) will
not return adequate results? :)

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 15 '06 #3

"Christo" <cm*****@googlemail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
novice with mysql so be slow.

Want to be able to update the contents of a database row through a
form, i want to be able to load the contents of a specific row

my database table is as follows

id(pk) | title | body | date(text field)
---------------------------------------------------------------------------
1 | hello | test | 15-11-2006 13:44
2 | again | test2 | 15-11-2006 13:45
basically i want to be able to add the contents of one of thw rows into
various forms, for instance lets say i want to edit all of the stuff in
the table which i do, and i want to add the title and the body into
forms respectively named title and body how would i do this?

I tried using a select statement to select all of the items from the
table in the database and put where id='".$id."'
Basically i dont have a clue wehre to start here so can someone please
help me
$query = "SELECT * FROM theTableName WHERE id='" . $idChosenForSearch . "'";
(That is a ' folled by a "; then
later a " followed by a ' followed by a ")

you have:

mysql_select_db($database, $dbLogin);
$result = mysql_query($query, $dbLogin) or die(mysql_error());

Where $dbLogin is the result of connecting to the database.

You extract the information as:

$row = mysql_fetch_assoc($result);
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];

Hope that helps to get you started.

Shelly
Nov 15 '06 #4
Thanks i got it all sorted now, was kind of a botch of everything that
i have read and it works so im smiling thanks everyone.

Chris
Shelly wrote:
"Christo" <cm*****@googlemail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
novice with mysql so be slow.

Want to be able to update the contents of a database row through a
form, i want to be able to load the contents of a specific row

my database table is as follows

id(pk) | title | body | date(text field)
---------------------------------------------------------------------------
1 | hello | test | 15-11-2006 13:44
2 | again | test2 | 15-11-2006 13:45
basically i want to be able to add the contents of one of thw rows into
various forms, for instance lets say i want to edit all of the stuff in
the table which i do, and i want to add the title and the body into
forms respectively named title and body how would i do this?

I tried using a select statement to select all of the items from the
table in the database and put where id='".$id."'
Basically i dont have a clue wehre to start here so can someone please
help me

$query = "SELECT * FROM theTableName WHERE id='" . $idChosenForSearch . "'";
(That is a ' folled by a "; then
later a " followed by a ' followed by a ")

you have:

mysql_select_db($database, $dbLogin);
$result = mysql_query($query, $dbLogin) or die(mysql_error());

Where $dbLogin is the result of connecting to the database.

You extract the information as:

$row = mysql_fetch_assoc($result);
$title = $row['title'];
$body = $row['body'];
$date = $row['date'];

Hope that helps to get you started.

Shelly
Nov 15 '06 #5

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

Similar topics

16
by: Picho | last post by:
Hi all, Is there any .NET way (I am not rulling out API usage) to add button(s) to a form's title bar? I found some non-.NET solutions that did actually work in VB6 but not in the ..NET...
7
by: Andy Bates | last post by:
I have hopefully a simple problem in C#. I designed a form with a listview on left, vert splitter against that, then the remainder of the form from top to bottom: a listview, horiz splitter and...
2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
4
by: Dmitry Korolyov [MVP] | last post by:
When we use btnSubmit.Attributes = "javascript: this.disabled=true;" to make the button disabled and prevent users from clicking it again while form data still posting, there is no longer...
26
by: Simon Jefferies | last post by:
Hello, I am trying to add an item to a checked list box, like: clbList.Items.add("Hello",true) I get an error back: Run-time exception thrown: System.ArgumentOutOfRangeException -...
6
by: vb | last post by:
Hi, I am new to .Net. I am using a Combo Box in my windows forms. I am adding the items by creating the instances and adding the same to the list. My questions/doubts are: 1. If I have 25 to...
9
by: Kadett | last post by:
Hi all, I have following problem: I'm creating a ListView (Details) control at run-time and filling it with some records (let's say 10 000). This operation seems to be quite fast, but when I call...
34
by: bitsnbytes64 | last post by:
Hi, I've been having a similar issue to what is described in the "refresh a form" post with a ComboBox that is not being refreshed after adding a new value on a seperate form. The second form is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.