MySQL Error Message

Just learned the basics of dynamic content within the last
week through resources here at Adobe and really dont know where to
start looking to fix this error so I came here.
The error keeps coming up when I try to edit a table's query.
SQL query:
A
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'A' at line 1
But the thing is when I edit on my local wamp server it edits
just fine and saves. So I've pretty much narrowed it down to
something that has to do with my user/password on my isp server.
I'm just a beginner and this question has probably been asked
before, so go easy on me.

JohnGJ wrote:
> I changed them to apostrophe's and still got the same
error message.
>
> I have the same exact article on my local server, and it
works fine when I
> update it.
>
> This seems like a very unique problem as I cant find it
anywhere on any other
> forums.
No, it's not a very unique problem. It's almost certainly a
question of
incorrectly escaped quotes or special characters. The server
behaviors
in Dreamweaver handle all of this correctly for you. If
you're
hand-coding, you need to remove any magic quotes and filter
your data
through mysql_real_escape_string(). More details here:
http://docs.php.net/manual/en/function.mysql-real-escape-string.php
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • [Help] Replace MySQL error message

    In insert form, I want to post a especial error message, instead of mysql_error
    here an example:
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "insert_form")) {
      $insertSQL = sprintf("INSERT INTO stuff (title, numbers) VALUES (%s, %s)",
                           GetSQLValueString($_POST['titla'], "text"),
                           GetSQLValueString($_POST['numbers'], "int") );
      mysql_select_db($database_connection, $connection);
      $Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
    cause i get an error like cannot be null
    Thanks.
    [Subject line edited by moderator to make it more meaningful]

    If you want to replace the MySQL error message, you can put your own error message in quotes in the die() command. Change this:
    $Result1 = mysql_query($insertSQL, $connection) or die(mysql_error());
    to this:
    $Result1 = mysql_query($insertSQL, $connection) or die('Database error');
    However, that's not very helpful to a user, because all that will be displayed is "Database error" with no indication of what caused the error or any way of returning to the page, except by using the browser back button.
    A better way of handling things is to remove the or die(mysql_error()) section of code altogether and replace it with a PHP conditional statement that sends the user to an error page if the SQL fails for any reason. However, making these changes will prevent you from making further edits to the server behavior through the Server Behaviors panel.
    $Result1 = mysql_query($insertSQL, $connection);
    if (!$Result1) {
      $insertGoTo = 'error.php';
    } else {
      $insertGoTo = 'another_page.php' // <-- this is the original $insertGoTo line

  • PHP/MySql Error Message

    I've posted this before and didn't get the answer that I need, probably because I didn't post all of my codes. I am using PHP/MySql.  I created a website that has several forms.  When I process three of the forms, I get the error messages below:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Condition, Length, Color, City, `State`, Email, Photo) VALUES ('29', '4', 'Used'' at line 1.
    Below I am posting the codes.  Hopefully, this time I posted everything that I should have so that I can get assistance.   
    FORM
    <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td colspan="3"><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="City" type="text" class="test" id="City" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="State" class="test" id="State">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="Email" type="text" class="test" id="Email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="Confirm Email2" type="text" class="test" id="Confirm Email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
      <input type="hidden" name="MM_insert" value="individual" />
    </form>
    SERVER BEHAVIOR
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (postingTitle, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['Posting Title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['Condition'], "text"),
                           GetSQLValueString($_POST['Length'], "text"),
                           GetSQLValueString($_POST['Color'], "text"),
                           GetSQLValueString($_POST['City'], "text"),
                           GetSQLValueString($_POST['State'], "text"),
                           GetSQLValueString($_POST['Email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));
    DATABASE CONNECTION
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_bridesmaidsrack_db = "localhost";
    $database_bridesmaidsrack_db = "bridesmaidsrack";
    $username_bridesmaidsrack_db = "";
    $password_bridesmaidsrack_db = "";
    $bridesmaidsrack_db = mysql_pconnect($hostname_bridesmaidsrack_db, $username_bridesmaidsrack_db, $password_bridesmaidsrack_db) or trigger_error(mysql_error(),E_USER_ERROR);

    Hi David,
    I did as you recommended. For good measure, I even changed the case of the letters to make sure that they coincide with exactly what's in the database.  I still kept getting the same error message.  So I deleted the recordset and attempted to recreate it.  When I attempted to recreate the record set, I got the following error message: "RangeError: invalid array length".  My codes are listed below:
    Form:
    <form method="POST" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td colspan="3"><span id="sprytextfield1">
          <label>
            <input name="posting_title" type="text" class="test" id="posting_title" size="35" />
            </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td colspan="3"><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
      <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
            </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td colspan="3"><label>
          <select name="condition" class="test" id="condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td colspan="3"><label>
          <select name="length" class="test" id="length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td colspan="3" class="td"><span id="sprytextfield5">
          <label>
            <input name="color" type="text" class="test" id="color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="city" type="text" class="test" id="city" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
        <td class="td"> </td>
        <td class="td"> </td>
      </tr>
      <tr>
        <td class="td">State</td>
        <td colspan="3"><label>
          <select name="state" class="test" id="state">
            <option>AL</option>
            <option>AK</option>
            <option>AZ</option>
            <option>AR</option>
            <option>CA</option>
            <option>CO</option>
            <option>CT</option>
            <option>DE</option>
            <option>DC</option>
            <option>FL</option>
            <option>GA</option>
            <option>HI</option>
            <option>ID</option>
            <option>IL</option>
            <option>IN</option>
            <option>IA</option>
            <option>KS</option>
            <option>KY</option>
            <option>LA</option>
            <option>ME</option>
            <option>MD</option>
            <option>MA</option>
            <option>MI</option>
            <option>MN</option>
            <option>MS</option>
            <option>MO</option>
            <option>MT</option>
            <option>NE</option>
            <option>NV</option>
            <option>NH</option>
            <option>NJ</option>
            <option>NM</option>
            <option>NY</option>
            <option>NC</option>
            <option>ND</option>
            <option>OH</option>
            <option>OK</option>
            <option>OR</option>
            <option>PA</option>
            <option>RI</option>
            <option>SC</option>
            <option>SD</option>
            <option>TN</option>
            <option>TX</option>
            <option>UT</option>
            <option>VT</option>
            <option>VA</option>
            <option>WA</option>
            <option>WV</option>
            <option>WI</option>
            <option>WY</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Email</td>
        <td colspan="3"><span id="sprytextfield3">
          <label>
            <input name="email" type="text" class="test" id="email" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Confirm Email</td>
        <td colspan="3"><span id="spryconfirm1">
          <label>
            <input name="confirm_email2" type="text" class="test" id="confirm_email2" size="35" />
          </label>
          <span class="confirmRequiredMsg">Required</span><span class="confirmInvalidMsg">The values don't match.</span></span></td>
      </tr>
      <tr>
        <td height="26" class="td">Photo(s)</td>
        <td colspan="3"><label>
          <input name="Photo" type="file" class="test" id="Photo" size="35" />
        </label></td>
      </tr>
      <tr>
        <td height="131" class="td">Additional Details</td>
        <td colspan="3"><label>
          <textarea name="Additional Details" cols="40" rows="6" class="test" id="Additional Details"></textarea>
          <input name="hiddenField" type="hidden" id="hiddenField" value="Date" />
        </label></td>
      </tr>
      </table>
      <p>
        <label>
          <input name="Submit" type="submit" class="test" id="Submit" value="Post" />
        </label>
      </p>
    </form>
    Server Behavior
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "individual")) {
      $insertSQL = sprintf("INSERT INTO donations (posting_title, `size`, condition, length, color, city, `state`, email, photo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
                           GetSQLValueString($_POST['posting_title'], "text"),
                           GetSQLValueString($_POST['size'], "text"),
                           GetSQLValueString($_POST['condition'], "text"),
                           GetSQLValueString($_POST['length'], "text"),
                           GetSQLValueString($_POST['color'], "text"),
                           GetSQLValueString($_POST['city'], "text"),
                           GetSQLValueString($_POST['state'], "text"),
                           GetSQLValueString($_POST['email'], "text"),
                           GetSQLValueString($_POST['Photo'], "text"));
      mysql_select_db($database_bridesmaidsrack_db, $bridesmaidsrack_db);
      $Result1 = mysql_query($insertSQL, $bridesmaidsrack_db) or die(mysql_error());
      $insertGoTo = "donations.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s", $insertGoTo));

  • Mysql error message on installation?

    when i installed mysql i got this message:
    WARNING: The host 'ArchStigma' could not be looked up with resolveip.
    This probably means that your libc libraries are not 100 % compatible
    with this binary MySQL version. The MySQL daemon, mysqld, should work
    normally with the exception that host name resolving will not work.
    This means that you should use IP addresses instead of hostnames
    when specifying MySQL privileges !
    although i can use the command line, i can't use mysql workbench, it gives me an error:
    Cannot Connect to Database Server
    Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
      Lost connection to MySQL server at 'reading initial communication packet', system error: 111
    Please:
    1 Check that mysql is running on server 127.0.0.1
    2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
    3 Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
    4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
    i've tried putting my ip address and/or "localhost" as the hostname, but i get the same problem.
    what can i do???
    Last edited by infernalarch (2010-11-11 16:11:07)

    whatshisname wrote:
    wonder wrote:
    whatshisname wrote:
    In my.cnf:
    change
    bind-address         = 127.0.0.1
    to
    bind-address            = 0.0.0.0
    restart server
    not enough and kinda stupid to listen to all interfaces(security problem). you only need to comment out skip-networking
    You learn something new every day.  But the original poster will also have to comment out: "bind-address = 127.0.0.1" as well, won't he?  At least that what I had to do on my workstation.
    i put the skip-networking line as a comment and still can't get workbench to work, by the way i do not have the line "bind-address = 127.0.0.1"
    i´really don't know what to do..
    please help.

  • OT: MySQL Error #1064

    I used phpMyAdmin to insert several new rows in a database
    table, then I
    suddenly hit a brick wall with this error message:
    MySQL said:
    #1064 - You have an error in your SQL syntax; check the
    manual that
    corresponds to your MySQL server version for the right syntax
    to use
    near '(`Key2`, `ID`, `Site2`, `Articles`, `Contents`,
    `Links`) VALUES
    ('19', 'China'' at line 1
    I think this is the same error message I used to get on my PC
    every now
    and then. It doesn't offer any clues as to the nature of the
    problem,
    and it isn't easy to track down via Google.
    I think I either fixed it or found a workaround once before,
    but I can't
    recall the solution. I don't know if it was a related problem
    or
    something entirely different, but I think I recall a
    situation where my
    database table's cardinality was limited to a certain number,
    and it
    wouldn't allow me to insert any additional rows for some
    reason. But I
    don't know if that's the problem in this case or not.
    Does anyone have any suggestions?

    David Powers wrote:
    > David Blomstrom wrote:
    >> I used phpMyAdmin to insert several new rows in a
    database table, then
    >> I suddenly hit a brick wall with this error message:
    >>
    >> MySQL said:
    >> #1064 - You have an error in your SQL syntax; check
    the manual that
    >> corresponds to your MySQL server version for the
    right syntax to use
    >> near '(`Key2`, `ID`, `Site2`, `Articles`,
    `Contents`, `Links`) VALUES
    >> ('19', 'China'' at line 1
    >>
    >> I think this is the same error message I used to get
    on my PC every
    >> now and then. It doesn't offer any clues as to the
    nature of the problem,
    >
    > The error message has nothing to do with PC or Mac. It's
    a MySQL error
    > message, and it's very precise. It not only tells you
    that you have a
    > syntax error in your SQL query; it tells you exactly
    where the error is:
    > near '(`Key2`, `ID`,...'
    >
    > In other words, the syntax error immediately precedes
    (`Key2`, `ID`,...
    >
    > You need to examine the SQL itself to determine the
    nature of the syntax
    > error.
    >
    Thanks for the tip, though I'm still confused. I simply used
    phpMyAdmin
    to insert a new row, then began by typing "19" into the first
    available
    space. There is nothing before that. I don't know how to
    examine the
    "SQL itself," as there is none that I'm aware of.
    I simply inserted a few values, as I had done on several
    previous
    occasions. I then experimented by NOT inserting certain
    values and by
    inserting different values, but nothing worked.
    I tracked "1064" through Google, and the problems appear to
    be all over
    the map. One guy said his database table was too big, and he
    solved the
    problem by breaking it up into several smaller tables.
    At any rate, I finally created a new table and imported a CSV
    file that
    automatically filled a few fields for several hundred rows.
    That
    automatically created the rows I need, and I was then able to
    insert
    articles where needed.
    Thanks.

  • Error message when I run searches on my website (PHP/MySQL help)

    Hey guys, can someone tell me why this is happening in my PHP? I run a search on my website and get this error message ye sI filled the hostname, username and password)
    Results for
    PHP Error Message
    Warning:  mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a8295382/public_html/Search Results.php on line 233
    Couldn't execute query
    Here is my PHP code:
    <?php
    $hostname_logon = "host" ;
    $database_logon = "hostname" ;
    $username_logon = username" ;
    $password_logon = "password" ;
    //open database connection
    $connections = mysql_connect($hostname_logon, $username_logon, $password_logon) or die ( "Unabale to connect to the database" );
    //select database
    mysql_select_db($database_logon) or die ( "Unable to select database!" );
    //specify how many results to display per page
    $limit = 15;
    //get the search variable from URL
    $var = mysql_real_escape_string(@$_REQUEST['q']);
    //get pagination
    $s = mysql_real_escape_string($_REQUEST['s']);
    //set keyword character limit
    if(strlen($var) < 3){
        $resultmsg =  "<p>Search Error</p><p>Keywords with less then three characters are omitted...</p>" ;
    //trim whitespace from the stored variable
    $trimmed = trim($var);
    $trimmed1 = trim($var);
    //separate key-phrases into keywords
    $trimmed_array = explode(" ",$trimmed);
    $trimmed_array1 = explode(" ",$trimmed1);
    // check for an empty string and display a message.
    if ($trimmed == "") {
        $resultmsg =  "<p>Search Error</p><p>Please enter a search...</p>" ;
    // check for a search parameter
    if (!isset($var)){
        $resultmsg =  "<p>Search Error</p><p>We don't seem to have a search parameter! </p>" ;
    // Build SQL Query for each keyword entered
    foreach ($trimmed_array as $trimm){
    // EDIT HERE and specify your table and field names for the SQL query
    // MySQL "MATCH" is used for full-text searching. Please visit mysql for details.
    $query = "SELECT * , MATCH (field1, field2) AGAINST ('".$trimm."') AS score FROM table_name WHERE MATCH (field1, field2) AGAINST ('+".$trimm."') ORDER BY score DESC";
    // Execute the query to  get number of rows that contain search kewords
    $numresults=mysql_query ($query);
    $row_num_links_main =mysql_num_rows ($numresults);
    //If MATCH query doesn't return any results due to how it works do a search using LIKE
    if($row_num_links_main < 1){
        $query = "SELECT * FROM table_name WHERE field1 LIKE '%$trimm%' OR field2 LIKE '%$trimm%'  ORDER BY field3 DESC";
        $numresults=mysql_query ($query);
        $row_num_links_main1 =mysql_num_rows ($numresults);
    // next determine if 's' has been passed to script, if not use 0.
    // 's' is a variable that gets set as we navigate the search result pages.
    if (empty($s)) {
         $s=0;
      // now let's get results.
      $query .= " LIMIT $s,$limit" ;
      $numresults = mysql_query ($query) or die ( "Couldn't execute query" );
      $row= mysql_fetch_array ($numresults);
      //store record id of every item that contains the keyword in the array we need to do this to avoid display of duplicate search result.
      do{
          $adid_array[] = $row[ 'field_id' ];
      }while( $row= mysql_fetch_array($numresults));
    } //end foreach
    //Display a message if no results found
    if($row_num_links_main == 0 && $row_num_links_main1 == 0){
        $resultmsg = "<p>Search results for: ". $trimmed."</p><p>Sorry, your search returned zero results</p>" ;
    //delete duplicate record id's from the array. To do this we will use array_unique function
    $tmparr = array_unique($adid_array);
    $i=0;
    foreach ($tmparr as $v) {
       $newarr[$i] = $v;
       $i++;
    //total result
    $row_num_links_main = $row_num_links_main + $row_num_links_main1;
    // now you can display the results returned. But first we will display the search form on the top of the page
    echo '<form action="search.php" method="get">
            <div>
            <input name="q" type="text" value="'.$q.'">
            <input name="search" type="submit" value="Search">
            </div>
    </form>';
    // display an error or, what the person searched
    if( isset ($resultmsg)){
        echo $resultmsg;
    }else{
        echo "<p>Search results for: <strong>" . $var."</strong></p>";
        foreach($newarr as $value){
        // EDIT HERE and specify your table and field unique ID for the SQL query
        $query_value = "SELECT * FROM newsight_articles WHERE field_id = '".$value."'";
        $num_value=mysql_query ($query_value);
        $row_linkcat= mysql_fetch_array ($num_value);
        $row_num_links= mysql_num_rows ($num_value);
        //create summary of the long text. For example if the field2 is your full text grab only first 130 characters of it for the result
        $introcontent = strip_tags($row_linkcat[ 'field2']);
        $introcontent = substr($introcontent, 0, 130)."...";
        //now let's make the keywods bold. To do that we will use preg_replace function.
        //Replace field
          $title = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" , $row_linkcat[ 'field1' ] );
          $desc = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" , $introcontent);
          $link = preg_replace ( "'($var)'si" , "<strong>\\1</strong>" ,  $row_linkcat[ 'field3' ]  );
            foreach($trimmed_array as $trimm){
                if($trimm != 'b' ){
                    $title = preg_replace( "'($trimm)'si" ,  "<strong>\\1</strong>" , $title);
                    $desc = preg_replace( "'($trimm)'si" , "<strong>\\1</strong>" , $desc);
                    $link = preg_replace( "'($trimm)'si" ,  "<strong>\\1</strong>" , $link);
                 }//end highlight
            }//end foreach $trimmed_array
            //format and display search results
                echo '<div class="search-result">';
                    echo '<div class="search-title">'.$title.'</div>';
                    echo '<div class="search-text">';
                        echo $desc;
                    echo '</div>';
                    echo '<div class="search-link">';
                    echo $link;
                    echo '</div>';
                echo '</div>';
        }  //end foreach $newarr
        if($row_num_links_main > $limit){
        // next we need to do the links to other search result pages
            if ($s >=1) { // do not display previous link if 's' is '0'
                $prevs=($s-$limit);
                echo '<div class="search_previous"><a href="'.$PHP_SELF.'?s='.$prevs.'&q='.$var.'">Previous</a>
                </div>';
        // check to see if last page
            $slimit =$s+$limit;
            if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {
                // not last page so display next link
                $n=$s+$limit;
                echo '<div  class="search_next"><a href="'.$PHP_SELF.'?s='.$n.'&q='.$var.'">Next</a>
                </div>';
        }//end if $row_num_links_main > $limit
    }//end if search result
    ?>
    Anyone got any ideas as to why this is happening?
    Also, I have not created any tables in my database... is this why it doesn't display any search results from my website?

    Sorry, but it doesn't help JTANNA.
    What is your definition of "more efficiently"? If it's limitation of search results, branded search, and limitation of styling your results then google search is more efficient. Real developers rely on their own developments. For example: how can google search display results from a password-protected site? They can't.
    best,
    Shocker

  • Error message when trying to access mySQL DB

    Dear forum,
    i am getting the error message below when I try to access the mySQL DB on localhost.
    I hat copied the jdbc driver mysql-connector-java-3.0.15-ga-bin.jar to the lib folder of the project.
    This is what my web.xml file looks like:
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <context-param>
    <param-name>
    javax.servlet.jsp.jstl.sql.dataSource
    </param-name>
    <param-value>
    jdbc:mysql://127.0.0.1:3306/jsp, com.mysql.jdbc.Driver, root, testpass.
    </param-value>
    </context-param>
    <context-param>
    <param-name>
    javax.servlet.jsp.jstl.sql.maxRows
    </param-name>
    <param-value>
    100
    </param-value>
    </context-param>
    </web-app>
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax.servlet.jsp.JspTagException: In <driver>, invalid driver class name: "java.lang.ClassNotFoundException: com/mysql/jdbc/Driver"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.find_jsp._jspService(find_jsp.java:74)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: com/mysql/jdbc/Driver
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper.setDriverClassName(Unknown Source)
         org.apache.taglibs.standard.tag.common.sql.DataSourceUtil.getDataSource(Unknown Source)
         org.apache.taglibs.standard.tag.common.sql.DataSourceUtil.getDataSource(Unknown Source)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(Unknown Source)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(Unknown Source)
         org.apache.jsp.find_jsp._jspx_meth_sql_query_0(find_jsp.java:93)
         org.apache.jsp.find_jsp._jspService(find_jsp.java:59)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

    Yes, it is there. In the exact same path.
    Does it have to be:
    <param-value>
    jdbc:mysql://127.0.0.1:3306/jsp, com.mysql.jdbc.Driver.class, root, testpass
    </param-value>
    instead of
    <param-value>
    jdbc:mysql://127.0.0.1:3306/jsp, com.mysql.jdbc.Driver, root, testpass
    </param-value>
    Probably not. Does it ?

  • How to get mysql error as a message on java

    hi,
    can any one please tell me how we can get the error generated by Mysql database during runtime as a message on a java program form.
    thanks

    try
      aSQLMethod();//this method is capable of throwing an SQLException
      catch(SQLException exc)
        String errorMessage=exc.getMessagae();//I don't understand what you want to do with this error message
      }

  • Error Message in mysql

    I tried to import my file into mysql I got the error message below.  I have no idea what this means or what to do.  Any assistance you can provide would be greatly appreciated.  Thank you.
    There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
    ERROR: Unknown Punctuation String @ 241
    STR: />
    SQL: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>form</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link href="table.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Container">
      <div id="header">
        <div id="Advertisment">Content for  id "Advertisment" Goes Here</div>
        <table width="325" align="right">
      <tr>
        <td class="Search">sign in</td>
        <td class="Search">Create account</td>
        <td class="Search">search</td>
      </tr>
    </table><br />
    <br />
        <table width="762">
      <tr>
        <td width="149"><img src="" alt="" name="Logo" width="136" height="92" id="Logo" /></td>
        <td width="601"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Home</a>        </li>
          <li><a href="#">about us</a></li>
          <li><a class="MenuBarItemSubmenu" href="#">the racks </a>
            <ul>
              <li><a href="#">single items</a>            </li>
              <li><a href="#">Group items</a></li>
              <li><a href="#">Donations</a></li>
              <li><a href="#">Giveaways</a></li>
            </ul>
          </li>
          <li><a href="#">contact us</a></li>
          <li><a href="#">Put it on the rack</a></li>
        </ul></td>
      </tr>
    </table>
      </div>
    </div>
    <p class="Header">Put it on the rack</p>
    <p class="Header"><span class="expiration">Your posting will expire in 30 days.</span></p>
    <form action="individual.php" method="post" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td colspan="2" class="td"><span id="spryradio1">
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" />
            Individual</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" />
            Group</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" />
            Giveaways</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" />
            Shoes</label>
          <br />
          <span class="radioRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City, State</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="location" type="text" class="test" id="location" size="35" />
          </label>
          <span class="textfieldRequiredMsg">City &amp;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>form</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link href="table.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Container">
      <div id="header">
        <div id="Advertisment">Content for  id "Advertisment" Goes Here</div>
        <table width="325" align="right">
      <tr>
        <td class="Search">sign in</td>
        <td class="Search">Create account</td>
        <td class="Search">search</td>
      </tr>
    </table><br />
    <br />
        <table width="762">
      <tr>
        <td width="149"><img src="" alt="" name="Logo" width="136" height="92" id="Logo" /></td>
        <td width="601"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Home</a>        </li>
          <li><a href="#">about us</a></li>
          <li><a class="MenuBarItemSubmenu" href="#">the racks </a>
            <ul>
              <li><a href="#">single items</a>            </li>
              <li><a href="#">Group items</a></li>
              <li><a href="#">Donations</a></li>
              <li><a href="#">Giveaways</a></li>
            </ul>
          </li>
          <li><a href="#">contact us</a></li>
          <li><a href="#">Put it on the rack</a></li>
        </ul></td>
      </tr>
    </table>
      </div>
    </div>
    <p class="Header">Put it on the rack</p>
    <p class="Header"><span class="expiration">Your posting will expire in 30 days.</span></p>
    <form action="individual.php" method="post" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td colspan="2" class="td"><span id="spryradio1">
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" />
            Individual</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" />
            Group</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" />
            Giveaways</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" />
            Shoes</label>
          <br />
          <span class="radioRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City, State</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="location" type="text" class="test" id="location" size="35" />
          </label>
          <span class="textfieldRequiredMsg">City &amp;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>form</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <link href="table.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Container">
      <div id="header">
        <div id="Advertisment">Content for  id "Advertisment" Goes Here</div>
        <table width="325" align="right">
      <tr>
        <td class="Search">sign in</td>
        <td class="Search">Create account</td>
        <td class="Search">search</td>
      </tr>
    </table><br />
    <br />
        <table width="762">
      <tr>
        <td width="149"><img src="" alt="" name="Logo" width="136" height="92" id="Logo" /></td>
        <td width="601"><ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Home</a>        </li>
          <li><a href="#">about us</a></li>
          <li><a class="MenuBarItemSubmenu" href="#">the racks </a>
            <ul>
              <li><a href="#">single items</a>            </li>
              <li><a href="#">Group items</a></li>
              <li><a href="#">Donations</a></li>
              <li><a href="#">Giveaways</a></li>
            </ul>
          </li>
          <li><a href="#">contact us</a></li>
          <li><a href="#">Put it on the rack</a></li>
        </ul></td>
      </tr>
    </table>
      </div>
    </div>
    <p class="Header">Put it on the rack</p>
    <p class="Header"><span class="expiration">Your posting will expire in 30 days.</span></p>
    <form action="individual.php" method="post" enctype="multipart/form-data" name="individual" class="individual" id="individual">
      <table width="594" border="0" class="test">
      <tr></tr>
      <tr>
        <td colspan="2" class="td"><span id="spryradio1">
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" />
            Individual</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" />
            Group</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" />
            Giveaways</label>
          <br />
          <label>
            <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" />
            Shoes</label>
          <br />
          <span class="radioRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td width="166" class="td">Posting Title</td>
        <td><span id="sprytextfield1">
          <label>
            <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">Price</td>
        <td><span id="sprytextfield2">
          <label>
            <input name="price" type="text" class="test" id="price" size="35" />
          </label>
          <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
      </tr>
      <tr>
        <td class="td">Size(s)</td>
        <td><label>
          <select name="size" size="1" multiple="multiple" class="test" id="size">
    <option>0</option>
            <option>2</option>
            <option>4</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
            <option>14</option>
            <option>16</option>
            <option>18</option>
            <option>20</option>
            <option>22</option>
            <option>24</option>
            <option>26</option>
          </select>
          <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td>
      </tr>
      <tr>
        <td class="td">Condition</td>
        <td><label>
          <select name="Condition" class="test" id="Condition">
    <option>New</option>
            <option>Used</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Length</td>
        <td><label>
          <select name="Length" class="test" id="Length">
    <option>Long</option>
    <option>Short</option>
    <option>Mid-Length</option>
          </select>
        </label></td>
      </tr>
      <tr>
        <td class="td">Color(s)</td>
        <td class="td"><span id="sprytextfield5">
          <label>
            <input name="Color" type="text" class="test" id="Color" size="35" />
          </label>
          <span class="textfieldRequiredMsg">Required</span></span></td>
      </tr>
      <tr>
        <td class="td">City, State</td>
        <td class="td"><span id="sprytextfield4">
          <label>
            <input name="location" type="text" class="test" id="location" size="35" />
          </label>
          <span class="textfieldRequiredMsg">City &amp;
    SQL query:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>form</title> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationRadio.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationConfirm.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="table.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationConfirm.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="Container"> <div id="header"> <div id="Advertisment">Content for id "Advertisment" Goes Here</div> <table width="325" align="right"> <tr> <td class="Search">sign in</td> <td class="Search">Create account</td> <td class="Search">search</td> </tr> </table><br /> <br /> <table width="762"> <tr> <td width="149"><img src="" alt="" name="Logo" width="136" height="92" id="Logo" /></td> <td width="601"><ul id="MenuBar1" class="MenuBarHorizontal"> <li><a href="#">Home</a> </li> <li><a href="#">about us</a></li> <li><a class="MenuBarItemSubmenu" href="#">the racks </a> <ul> <li><a href="#">single items</a> </li> <li><a href="#">Group items</a></li> <li><a href="#">Donations</a></li> <li><a href="#">Giveaways</a></li> </ul> </li> <li><a href="#">contact us</a></li> <li><a href="#">Put it on the rack</a></li> </ul></td> </tr> </table> </div> </div> <p class="Header">Put it on the rack</p> <p class="Header"><span class="expiration">Your posting will expire in 30 days.</span></p> <form action="individual.php" method="post" enctype="multipart/form-data" name="individual" class="individual" id="individual"> <table width="594" border="0" class="test"> <tr></tr> <tr> <td colspan="2" class="td"><span id="spryradio1"> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_0" /> Individual</label> <br /> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_1" /> Group</label> <br /> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_2" /> Giveaways</label> <br /> <label> <input type="radio" name="RadioGroup1" value="radio" id="RadioGroup1_3" /> Shoes</label> <br /> <span class="radioRequiredMsg">Required</span></span></td> </tr> <tr> <td width="166" class="td">Posting Title</td> <td><span id="sprytextfield1"> <label> <input name="Posting Title" type="text" class="test" id="Posting Title" size="35" /> </label> <span class="textfieldRequiredMsg">Required</span></span></td> </tr> <tr> <td class="td">Price</td> <td><span id="sprytextfield2"> <label> <input name="price" type="text" class="test" id="price" size="35" /> </label> <span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td> </tr> <tr> <td class="td">Size(s)</td> <td><label> <select name="size" size="1" multiple="multiple" class="test" id="size"> <option>0</option> <option>2</option> <option>4</option> <option>6</option> <option>8</option> <option>10</option> <option>12</option> <option>14</option> <option>16</option> <option>18</option> <option>20</option> <option>22</option> <option>24</option> <option>26</option> </select> <span class="Text">To select multiple sizes, hold ctrl and select each size.</span></label></td> </tr> <tr> <td class="td">Condition</td> <td><label> <select name="Condition" class="test" id="Condition"> <option>New</option> <option>Used</option> </select> </label></td> </tr> <tr> <td class="td">Length</td> <td><label> <select name="Length" class="test" id="Length"> <option>Long</option> <option>Short</option> <option>Mid-Length</option> </select> </label></td> </tr> <tr> <td class="td">Color(s)</td> <td class="td"><span id="sprytextfield5"> <label> <input name="Color" type="text" class="test" id="Color" size="35" /> </label> <span class="textfieldRequiredMsg">Required</span></span></td> </tr> <tr> <td class="td">City, State</td> <td class="td"><span id="sprytextfield4"> <label> <input name="location" type="text" class="test" id="location" size="35" /> </label> <span class="textfieldRequiredMsg">City &amp;
    MySQL said:
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or' at line 1

    In that section, you are supposed to be importing a sql file that contains the database ddl to create the structure of your database:
    In the File to import section, click the Browse button alongside the               Location of the text file text box; navigate to the Feedback folder on your               computer (Windows: C:\xampp\htdocs\Feedback, Mac OS X: Applications/MAMP/htdocs/Feedback),               select the data folder, and then the file feedback.sql.
    Click the Go button at the bottom of the page. This creates the               structure for the database used in this tutorial and adds initial data.
    Go back and make sure you have selected the feedback.sql file.

  • Error Message in Terminal: unknown variable 'datadir=/usr/local/mysql/data'

    Hello,
    I'm on a Mac Pro Quad Core Intel Xeon (64-bit) using OS 10.6.4. I have mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $ and PHP Version 5.3.1.
    I have also installed phpMyAdmin 3.3.1 and have set up the relations tables in a pmadb within mysql; created a new database with tables; and created some new users. I am able to access and use mysql via phpMyAdmin.
    But now I am unable to login to mysql via the Terminal command:
    mysql -u root -p
    which now returns an error message of:
    /usr/local/mysql/bin/mysql: unknown variable 'datadir=/usr/local/mysql/data'
    my.cnf file reads:
    [mysqld]
    datadir=/usr/local/mysql/data
    socket=/var/mysql/mysql.sock
    #skip-grant-tables=1
    [client]
    datadir=/usr/local/mysql/data
    socket=/var/lib/mysql/mysql.sock
    and I can see the data directory in that location when using the Terminal.
    My questions:
    1. Is this related to anything I have done in setting up phpMyAdmin (tables, users)?
    2. Is this a permissions problem with the directory named /usr/local/mysql/data?
    Currently, the permissions and ownership are this:
    drwxr-x--- 11 _mysql wheel 374 Jun 29 12:10 data
    3. Is this a problem from upgrading to 10.6.4 recently?
    4. Is this a my.cnf problem?
    I would really like to be able to do things in the Terminal with mysql in addition to using phpMyAdmin.
    Many thanks for any help on this.
    Best,
    Shelley

    Shelley Schreiber wrote:
    Thanks for your suggestion, etresoft, but this was not helpful, I'm afraid. Removing datadir=/usr/local/mysql/data did not work. And prior to using phpMyAdmin, I was able to login via Terminal with this in place.
    Try removing my.cnf. It isn't required and seems to be giving you problems.
    Also, the mysql socket value is what comes with new Macs with Snow Leopard.
    MySQL doesn't come on any new Mac except with Snow Leopard Server. I think we've had this conversation before and came to the conclusion that you don't have the server version, just a jacked up client.
    I am noticing that the Terminal error message I get is saying:
    /usr/local/mysql/bin/mysql: unknown variable . . .
    whereas the data directory path is /usr/local/mysql/data
    There is no data directory in /usr/local/mysql/bin/mysql
    The program that is reporting the error is is /usr/local/mysql/bin/mysql.
    My MySQL installation does not have a my.cnf file. It does have a number of example cnf files that I could use if I wanted to jack up my installation. None of them have a "datadir" value in them. If you don't want to get rid of my.cnf altogether, the just get rid of all of the datadir values inside it.

  • MySql connection error message "An unidentified error has occurred"

    I am trying to connect the Mysql database with dreamweaver
    but I keep getting the following error message:
    "An unidentified error has occurred". any idea what is wrong?
    Any help will be appreciated.
    SC Xiou

    SCXiou wrote:
    > I am trying to connect the Mysql database with
    dreamweaver but I keep getting
    > the following error message:
    > "An unidentified error has occurred".
    There are two common reasons for that happening:
    1. An incorrect testing server definition, or
    2. A software firewall is blocking access between MySQL and
    Dreamweaver.
    David Powers
    Adobe Community Expert, Dreamweaver
    http://foundationphp.com

  • Error message when populating drop-down list with mysql DB

    Hi everyone,
    i'm having an error message which gives zero result on google...
    here's the context: i have a drop-down list called "Patient" in the template pages of a livecycle form. The binding is set to Global so that the value is the same on the two pages of the form. I have also linked the items of the list to a mysql database (with DataConnection) by clicking the "Specify Item Values" link on the Binding tab of the element.
    now, when i open my form (or preview) i get this message, in french:
    "Propriété incorrecte de l'opération SET; dataGroup ne possède pas de propriété id."
    which is, in english (personal translation):
    "Incorrect property of the SET operation; dataGroup doesn't have an id property."
    this message appears in a messagebox, the background is empty (standard gray color)
    Then i click "OK" (which is the only button available), and my form appears, the list is populated with the values of my database table, so it actually works...
    As i said, i have zero results on google with this message...
    any idea what it means and how to avoid it?
    Thanks!

    Hi,
    For all things XFA Forms and Databases there is no place better than Stefan Cameron's blog: http://forms.stefcameron.com/.
    Have a look here: http://forms.stefcameron.com/2006/12/18/databases-inserting-updating-and-deleting-records/ and at comment 60.
    Good luck,
    Niall

  • When connecting to a database, dreamweaver gives the error message [MySQL Error

    When I try to connect my MySQL database into dreamweaver, I insert all of the information (name, server, username, password), and when i click on select database, it reads:
    MySQL Error#:1045
    Access denied for user 'mresnik_mresnik'@'192.185.5.169' (using password: YES)
    I am 100% sure that The details entered including username and password are correct, as I have contacted hostgator.com and they have stated that they can connect, and they advised that it may be an issue with either my files or dreamweaver.
    Any help would be very much appreciated.

    Login.php code:
    <?php require_once('Connections/drama_database.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['UserName'])) {
      $loginUsername=$_POST['UserName'];
      $password=$_POST['Password'];
      $MM_fldUserAuthorization = "userlevel";
      $MM_redirectLoginSuccess = "home.php";
      $MM_redirectLoginFailed = "loginfail.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_drama_database, $drama_database);
      $LoginRS__query=sprintf("SELECT username, password, userlevel FROM users WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $drama_database) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'userlevel');
        if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;         
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;  
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <html>
    <title>Drama Database - Login</title>
    <head>
        <link href="images/favicon.ico" rel="icon" />
    </head>
    </html>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <form ACTION="<?php echo $loginFormAction; ?>" id="loginform" name="loginform" method="POST">
    <!--visual -->
    <br>
    <br>
    <br>
    <div align="center">
      <!--ACS Logo -->
      <img src="images/logo_acs_egham.gif" width="387" height="59" /><br>
    <!--Drama Logo -->
    <br>
    <img src="images/bglogin.jpg" alt="Acs-Egham International School" width="246" height="153">
    <br>
    <!--Title -->
    <h2>Drama Database Login</h2>
    </center>
      </div>
      <table width="154" border="0" align="center">
        <tr>
          <td width="148">Username:<br />
            <span id="sprytextfield1">
            <label for="UserName"></label>
            <input type="text" name="UserName" id="UserName" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td>Password:<span id="sprytextfield2"><br />
            <label for="Password"></label>
            <input type="password" name="Password" id="Password" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td align="center"><input type="submit" name="LoginButton" id="LoginButton" value="Login" /></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
      </table>
    </form>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    </script>

  • No error messages in php

    Hi!
    I have an old computer witch I have installed apache, php and mysql. Every thing is working except from one thing (so far). I have tested that php works, but my problem is that I don't get any error messages back from the server if there is an error in my code. Can anybody please help me with getting my sweet, sweet errors:P

    Well, I'd look for an answer in Error Handling and Logging Functions chapter of PHP manual

  • Error Message in CF Admin CF 8 on Mac OS 10.5.7

    For some reason my connections to my local database don't work anymore. I keep getting this error message in CF admin when I verify my connection, any help would be appreciated.
    Mac OS 10.5.7 2.4 Ghz 4 GB RAM
    CF 8
    MySQL 4/5
    Connection verification failed for data source: nsgeuLocal
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused STACKTRACE: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.(Socket.java:367) at java.net.Socket.(Socket.java:209) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:173) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:267) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysicalConnection(JDBCPool.java:589) at coldfusion.server.j2ee.sql.pool.ConnectionRunner$RunnableConnection.run(ConnectionRunner. java:67) at java.lang.Thread.run(Thread.java:613) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago.
    The root cause was that: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused STACKTRACE: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432) at java.net.Socket.connect(Socket.java:520) at java.net.Socket.connect(Socket.java:470) at java.net.Socket.(Socket.java:367) at java.net.Socket.(Socket.java:209) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:173) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:267) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonReg...

    I just had this happen to me, but I fixed it. I am also using CF8 and MySQL 5 on my Mac (Leopard) for development purposes.  I had edited my hosts file and like a dummy I moved "127.0.0.1 localhost" from where is should be near the top down to the middle with my other mappings.
    I discovered this as the problem when I changed CF admin to use "127.0.0.1" instead of "localhost" and it verified the connection okay.  Obviously I want to make sure "localhost" is working properly too for this and many other reasons.
    Here's how I fixed it:
    1) Fixed my hosts file to have this at the top:
    # Host Database
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    #I had mistakenly commented the next line out:
    127.0.0.1        localhost
    255.255.255.255  broadcasthost
    ::1              localhost
    fe80::1%lo0      localhost
    2) Removed the entry for "localhost" I had put with my long list of domains for testing lower in the file.
    3) Flushed my cache via the terminal:
    dscacheutil -flushcache
    4) Stopped and started the Coldfusion server.  It actually encountered a problem and shutdown "ungracefully". No problems as I simply started it again and all is good.
    I hope this solution saves someone some time.  It pays to double-check your hosts file for errors, as well as your httpd-vhosts.conf file when serving locally.  This is handy for testing that file and Apache in general:
    apachectl configtest

Maybe you are looking for

  • To find cash discount due date for invoice

    Hi, is there any fuction module to get cash discount due date using Payment term Zterm, Ztag:1Days from Baseline Date for Payment and Ztag2:Days from Baseline Date for Payment from T052 table. Regards, santosh

  • Cannot cut and paste text completely in Pages

    I tried cutting and pasting some text from Safari--about 9 pages worth of text--to Pages, but it only pasted 2 pages. Is this a Snow Leopard problem? Or should I consider installing Word now?

  • How to configure an X86 Solaris 10 laptop as Jumpstarter for SPARC T1000?

    I believe that I have taken due diligence WRT using search and Google to research the topic. There is a little voice that says "hopefully you haven't and the answer is right there in front of you". That being said, I did find an article for [configur

  • What happened to the Zen Sle

    I see that the Zen Sleek has been pulled from many big-name stores (Best Buy, Circuit City.) Any ideas?

  • Login Error in BI launch Pad as user, BOBJ 4.0

    Hi Expert, I am not able login as user in Business object launch pad in order to check the folder assignment to user, error as follow upon login, "Account Information Not Recognized: Enterprise authentication could not log you on. Please make sure yo