Proper way to query a db?
| From: | Jay Proulx | Date: | Wed, 10 May 2000 01:00:19 +0000 |
| Subject: | Proper way to query a db? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6@lists.php.net to get a copy of this message | ||
I'm pretty new to this, so be gentle ;) (not with the code, just with flames ;)
I'm just trying to make a dynamically updatable news page for my website,
heres basically what I am trying to do, yeah, I know this is all wrong..
<?php
$conn = pg_Connect("dbname=database port=1234");
$query = "INSERT INTO news (varOne, varTwo, varThree) VALUES ($varOne, $varTwo,
$varThree);"; /* this is submitted from a form */
pg_Exec($conn, $query);
$query = "SELECT * FROM news WHERE varOne > 0"; /* varOne being an index */
pg_Exec($conn, $query);
while ($varOne > 0; $varOne++) {
echo ("formatted output");
};
pg_Close();
?>
Thanks in advance for the help..
Jay
- jayproulx@sympatico.ca
- http://digitalAnomaly.slf.cx