#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    12
    Rep Power
    0
    Sorry to pawn this off on you all, but I've gone back and forth on this darned thing and can't figure this out.

    I keep getting a parse error, which I assume means I have a problem in the PHP. The MySQL query works if I put it in directly in Telnet, but it gives me a parse error otherwise.

    HELP! ANY help would be GREATLY appreciated!

    <HTML><HEAD>
    <TITLE>Untitled</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
    <?php
    $server = "localhost";
    $user = "*****";
    $pass = "*****";
    $db = "chaco";
    $connection = mysql_connect($server, $user, $pass);
    $query = "SELECT * FROM trovemain WHERE (cata LIKE 'a%')";
    $result = mysql_db_query($db,$query,$connection);

    $row = mysql_fetch_array($result);

    printf("Name: ",echo $row["name"]);
    printf("<br>");
    echo $row["origin"];
    printf("<br>");
    echo $row["link"];

    ?>

    </BODY>
    </HTML>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    166
    Rep Power
    15
    >>> $query = "SELECT * FROM trovemain WHERE (cata LIKE 'a%')";

    Why the ()? This works:'

    $query = "SELECT * FROM trovemain WHERE cata LIKE 'a%'";
  4. #3
  5. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    Your error is in this line:

    printf("Name: ",echo $row["name"]);

    Also, why are you using printf? You aren't issueing in formatting parameters.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    12
    Rep Power
    0
    Is stupidity a good reason?

Similar Threads

  1. Frames hijacked after remote search
    By Telejoke in forum Antivirus Protection
    Replies: 2
    Last Post: September 26th, 2007, 09:32 AM
  2. simple search query
    By SeenGee in forum PHP Development
    Replies: 1
    Last Post: February 10th, 2004, 12:30 PM
  3. PHP/MYSQL wildcard search
    By aerris in forum PHP Development
    Replies: 3
    Last Post: February 3rd, 2004, 01:15 PM
  4. Cgi Search feature script
    By butsy_7 in forum Perl Programming
    Replies: 5
    Last Post: January 22nd, 2004, 07:43 PM
  5. php/mysql search multiple tables
    By Seilo in forum PHP Development
    Replies: 3
    Last Post: January 21st, 2004, 05:40 PM

IMN logo majestic logo threadwatch logo seochat tools logo