On Vie 17 Ago 2001 20:39, Dave.O wrote:
> No offence but you are telling me stuff I already know !   This mailing
> list is very good so dont take offence due to my frustration.  I know how
> to connect to the server, create the database and more or less query it,
> but cant find the command to add/insert records or am I doing something
> very wrong.  I presume this can be done in php

I don't use MySQL, but I'll give you an example.

Lets say you have a table in your database like this:

col1    INT (autoincremental)
col2    VARCHAR(50)

and say the name of the table is tab1

if you want to insert a new row with value 'Dave the great!' whihc is loaded 
in the $var1 variable, you just have to do this:

$query="INSERT INTO tab1 (col2) VALUES (" . $var1 . ")";

query_func($query);

All this after you have connected to the database with the connection 
function of the MySQL extension.

So, if the query went OK, you have a new record in the database with some 
value in the col1 (integer type) and 'Dave the great!' in col2.

Undestand?

-- 
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués                  |        [EMAIL PROTECTED]
Programador, Administrador, DBA |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to