Jump to content

missparx

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

missparx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for all the help guys... i got everything figured out (especially a better understanding of what exactly is going on)... took me a minute to figure out that nextval function was incrementing the id number everytime it was called i hate problems that.... thanks again...
  2. ok so the link helped a lot.... although i keep running into problems (the story of my life).... im trying to select the values from a specific id value in a psql table.... the table is as such id serial service varchar(10) description varchar(200) starttime timestamp(0) and such..... i keep getting errors when i try to display only one row containing a specific id number right now i have.... $id_request = pg_fetch_assoc(pg_query($conn, "SELECT nextval('servicestatus_id_seq')")); $result_service = pg_query("SELECT * FROM servicestatus WHERE id='$id_request'"); while($line = pg_fetch_array($result_service, null)) { foreach($line as $col_value) { echo "$col_value \n"; <------ i'm aware i'm displaying too much kinda trying to fix that } } i'm getting errors about the $id_request variable, right now $id_request echo'd returns "Array" and won't output $id_request[index] so when i delete the pg_fetch_assoc.... and echo $id_request i get Request id #4 or whatever number I just want the 4 part but i cannot get it...... ahhh i'm confused.....
  3. I'm new to php(and to SQL), at work I am working on a web page(html/php) that is dealing w/ a Postgres SQL database(obviously why I'm in this section) and I was wondering if there was a function (or a query) that allows me to assign variables to values within a table.... I started some code but got a little lost... I started with this... (not sure if it is usable at all) $select_variable = pg_query($conn, "SELECT blah blah blah FROM tablename WHERE id="$id_request"); but all of the php functions i can find are booleans.... is there any function that I can assign a variable to what I selected??? because I need to display those variables to the page. I hope this isnt a completely ridiculous question lol
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.