executing a statement

This is a discussion on executing a statement within the C++ Programming forums, part of the General Programming Boards category; i have to get a url from the terminal and place it in the sql query below but how? Code: ...

  1. #1
    Registered User devil@work's Avatar
    Join Date
    Mar 2003
    Posts
    33

    executing a statement

    i have to get a url from the terminal and place it in the sql query below but how?

    Code:
    mysql_query(conn,"SELECT site_id FROM sites WHERE site_url like '$url'");
    because of the " " i cant place it

  2. #2
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Look up sprintf( ).
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  3. #3
    Registered User devil@work's Avatar
    Join Date
    Mar 2003
    Posts
    33
    is there another function that i can use with iostream

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    strstreams are deprecated, tough to use properly and only in c++ for backward compatability with legacy c++ code. Modern c++ has stringstreams. These can do anything that a strstream could do but better and easier. Look up stringstream, ostingstream and istringstream in your help files/text for an overview.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 05:19 AM
  2. If Else statement problem
    By doofusboy in forum C Programming
    Replies: 2
    Last Post: 11-09-2005, 06:18 AM
  3. string & if statement
    By Curacao in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2003, 09:56 PM
  4. coredump problem when executing delete statement using Pro*C
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 05-13-2002, 10:48 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 03:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21