SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Is my SELECT syntax correct?

    Hi guys I have query codes below,

    Code:
    $offering = 'test';
    $query = $this->db->query("SELECT * FROM swap WHERE offering = $offering");
    if ($query->num_rows() > 0)
    {
       $row = $query->row(); 
       $swapid = $row->swap_id;
    }
    Is my SELECT codes correct?
    Please correct me if I'm wrong.

    Thanks in advanced.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    No. $offering contains a string, so you should put quotes around it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •