Jump to content

geradt

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by geradt

  1. That did the trick. Thanks again for your help.
  2. One more thing.... For some reason, its not creating a variable for the first row in the results? It starts on the second row? any idea why? do I need to do anything else to get it to returnt the first row? Thanks!
  3. Thanks Abra. Much appreciated. That did the trick. I appreciate your time and effort! Have a great day.
  4. Thanks Abra. That worked. The only issue is that some of the values in the fld_it colum have a dash in it. So when I try to use the variable later in the code it errors because of the dash. For example: FLD_ID = MGR-NM FLD_VL = FRANK your code does what I want and makes the following: $MGR-NM = 'FRANK'; But if I try to use that later on like this: echo $MGR-NM; it bombs becase it doesn't like the dash in the variable name. I think the only way around that is to remove the dashes from the FLD_ID's. Thanks for your help!
  5. Here is my code: $query2 = "SELECT fld_id, fld_vl FROM clnt_data $result2 = mysql_query($query2); mysql_close(); /Loads the user data into an array $clientData2 = mysql_fetch_array($result2, MYSQL_ASSOC); foreach($clientData2 as $k=>$v) $$k = $v; The foreach statement I used above puts the column name into the $k variable and then puts the actual values for fld_id and fld_vl into the $v variable. Instead I want the fld_id value to be the variable name and then set that variable equal to the fld_vl. I hope this makes sense.
  6. Hi everyone, I really need some help with a project I'm working on. I have a table in MySQL that I am querying to pull out some data. This is the results I am getting from my query: ----------------------------------------------- | fld_id | fld_vl | ----------------------------------------------- | CLNT_NM | Motel1 | | CLNT_MGR | Frank | | CLNT_TMZ | EST | ----------------------------------------------- What I would like to do is get a variable for each fld_id and populate it with the field value. So, in essence it would look like this. $CLNT_NM = 'Motel1'; $CLNT_MGR = 'Frank'; $CLNT_TMZ = 'EST'; How can I do this? I have tried to figure this out but I can't seem to do it. Any help you guys can provide would be greatly appreciated. THANKS in advance!!!
×
×
  • 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.