Quick Q?? - Make a variable the value of a table field??

Discussion in 'PHP' started by medialab, Dec 2, 2011.

  1. #1
    Hi I have a variable lets call it $variable1

    I have a table field (in a mySQL database) called 'date' I need to get $variable1 = 'date'

    I have already connected to the database, selected the table and specify row by id.

    how do I make the variable = the table field?

    Currently I have been using <?php echo $row['field'] ?>

    Everything works great, seems fast. Any help would be appreciated, I'm a few weeks into learning!!

    Thanks everyone!!
     
    Solved! View solution.
    medialab, Dec 2, 2011 IP
  2. #2
    Just put
    <?php $variable1 = $row['field']; ?>
     
    imtiyaz.jmi, Dec 3, 2011 IP
  3. medialab

    medialab Well-Known Member

    Messages:
    366
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    138
    Digital Goods:
    1
    #3
    You know that was my initial though, but then I made a small error in it and it didn't work so I went looking elsewhere, and thanks to you it works!! thanks!!!

     
    medialab, Dec 3, 2011 IP