Jump to content

stressedsue

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stressedsue's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I need to extract records from a database that start with a specific string field. I want to use LIKE in my statement to accomplish this, but could use an example to follow. I keep reading that I need to use the escape character with LIKE, but am not sure about the proper syntax. My statement currently looks something like this: $query_Sched1 = sprintf("SELECT * FROM schedule WHERE sem = %s AND (comment1 LIKE 'starts 03%') ORDER BY dept, number, section, orderby ASC", $colname_Sched); When I execute this, I receive this error message : "You have an error in your SQL syntax near 'LIMIT 0, 25' at line 1" Any help or examples on how to use 'LIKE' properly would be greatly appreciated. Thanks in advance!!!!
  2. Hello, I want to display an image dynamically within the printf() function, where the image name resides on a database.  How do I embed the image name within the <img src> tag, which is within the printf() function? Example of code that does not work: printf("<tr>     <td>     <p><img src='../art/'>%s</p>     </td>     </tr>\n", $myrow["photoname"]"); Any help is greatly appreciated!!!  
×
×
  • 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.