[ADMIN] access data in php

2009-01-02 Thread Marc Fromm
If I gather the sql results with this code $results = pg_query($dbconn,$query); I can check if there is no returned data with this code $rows = pg_fetch_assoc($result); but if I then use a while loop to display data (if there is data returned) with this code while ($row =

Re: [ADMIN] access data in php

2009-01-02 Thread Scott Marlowe
On Fri, Jan 2, 2009 at 10:11 AM, Marc Fromm marc.fr...@wwu.edu wrote: If I gather the sql results with this code $results = pg_query($dbconn,$query); I can check if there is no returned data with this code $rows = pg_fetch_assoc($result); but if I then use a while loop to display data (if

Re: [ADMIN] access data in php

2009-01-02 Thread ioguix
On Fri, 2 Jan 2009, Marc Fromm wrote: If I gather the sql results with this code $results = pg_query($dbconn,$query);   I can check if there is no returned data with this code $rows = pg_fetch_assoc($result);   but if I then use a while loop to display data (if there is data returned) with

Re: [ADMIN] access data in php

2009-01-02 Thread Scott Marlowe
On Fri, Jan 2, 2009 at 11:09 AM, iog...@free.fr wrote: pg_fetch_assoc behave like pg_fetch_array: it increments the internal pointer to the current result. So if you call it once, then pg_fetch_array will return the 2nd result in the result set. Wow, I'm so used to seeing $rows =

Re: [ADMIN] access data in php

2009-01-02 Thread Marc Fromm
My results are missing the first record as you explained. -Original Message- From: iog...@free.fr [mailto:iog...@free.fr] Sent: Friday, January 02, 2009 10:09 AM To: Marc Fromm Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] access data in php On Fri, 2 Jan 2009, Marc Fromm wrote:

Re: [ADMIN] access data in php

2009-01-02 Thread Marc Fromm
This is my code: ?php $dbconn = pg_connect(host=localhost port=5432 user=postgres dbname=studentalerts); if(isset($_GET[value])){ $w_number=$_GET[value]; } //echo $w_number; $query = select first_name, last_name, alert from alert_list where w_number='$w_number'; $result =

Re: [ADMIN] access data in php

2009-01-02 Thread Chander Ganesan
Marc Fromm wrote: This is my code: ?php $dbconn = pg_connect(host=localhost port=5432 user=postgres dbname=studentalerts); if(isset($_GET[value])){ $w_number=$_GET[value]; } //echo $w_number; $query = select first_name, last_name, alert from alert_list where w_number='$w_number';

Re: [ADMIN] access data in php

2009-01-02 Thread Scott Marlowe
On Fri, Jan 2, 2009 at 12:40 PM, Marc Fromm marc.fr...@wwu.edu wrote: This is my code: ?php $dbconn = pg_connect(host=localhost port=5432 user=postgres dbname=studentalerts); if(isset($_GET[value])){ $w_number=$_GET[value]; } You need to scrub user input. use