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 &<!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 &<!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 &
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 &
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.
Similar Messages
-
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 ? -
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)); -
[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 -
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,
ShelleyShelley 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. -
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/ -
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 XiouSCXiou 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 -
Snort error since recent mysql update
Is anybody else seeing this error message when they execute snort? I'm not sure if this is my setup or a bug that needs to be reported.
"snort: error while loading shared libraries: libmysqlclient.so.14: cannot open shared object file: No such file or directory"
This error returns when executing either the snort binary in the Arch snort package or a self compiled snort binary.
The libmysqlclient.so.14 file does exist, it is here:
/usr/lib/mysql
-rwxr-xr-x 1 root root 888 Oct 27 11:11 libmysqlclient.la
lrwxrwxrwx 1 root root 24 Oct 27 12:17 libmysqlclient.so -> libmysqlclient.so.14.0.0
lrwxrwxrwx 1 root root 24 Oct 27 12:17 libmysqlclient.so.14 -> libmysqlclient.so.14.0.0
-rwxr-xr-x 1 root root 1.1M Oct 27 11:11 libmysqlclient.so.14.0.0
Thanks,
CraigI am seeing the same problem with my perl scripts that use DBI.
bash> ldd /usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/DBD/mysql/mysql.so
linux-gate.so.1 => (0xffffe000)
libmysqlclient.so.12 => not found
libz.so.1 => /usr/lib/libz.so.1 (0x40025000)
libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0x40037000)
libnsl.so.1 => /lib/tls/libnsl.so.1 (0x40064000)
libm.so.6 => /lib/tls/libm.so.6 (0x40079000)
libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0x4009c000)
libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0x400cd000)
libc.so.6 => /lib/tls/libc.so.6 (0x401d3000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libdl.so.2 => /lib/tls/libdl.so.2 (0x40309000)
mysql.so is refrencing libmysqlclient.so.12 which is no longer available due to upgrade. -
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:PWell, 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 -
I keep getting the following error message when I click login on my sample login page:
Error: 500
Location: /examples/jsp/gcdBB/Login.jsp
Internal Servlet Error:
javax.servlet.ServletException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near '"USERNAME", "PASSWORD") VALUES ('admin','admin')' at line 1"
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
at jsp.gcdBB._0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6._jspService(_0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6.java:97)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown Source)
Root cause:
java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near '"USERNAME", "PASSWORD") VALUES ('admin','admin')' at line 1"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1628)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1806)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1740)
at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1309)
at jsp.gcdBB._0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6._jspService(_0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6.java:87)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown Source)
How can i solve this error?Here is the section of code in question:
<%
Class.forName("org.gjt.mm.mysql.Driver");
java.sql.Connection connection=java.sql.DriverManager.getConnection
("jdbc:mysql://localhost:8080/gcdBB_db");
java.sql.Statement statement = connection.createStatement();
Enumeration parameters = request.getParameterNames();
if(parameters.hasMoreElements())
String usernameValue = request.getParameter("username");
String passwordValue = request.getParameter("password");
statement.executeUpdate("INSERT INTO USERS (\"USERNAME\", \"PASSWORD\") VALUES ('"+usernameValue+"','"+passwordValue+"')");
%>
Any ideas to solving the problem? -
Error connecting to MySQL database using JNDI
Hi,
I'm trying to do a simple connection to a MySQL database using the JNDI look-up
method.
Have tried this with the PointBase database that came with WebLogic and got it
to work successfully.
However got the attached error message when I tried it on MySQL database. I tried
this with both the WebLogic's driver for MySQL and also the one I downloaded from
MySQL (com.mysql.jdbc.Driver), and both failed with the same error message.
Offhand, it doesn't look like the connection pool is failing. Tested it with WebLogic's
"Test Pool" function and it was alright.
Also MySQL database is working properly. Test this by doing simple connection
and retrieval with simple JDBC connections and it works.
Any ideas what else I can check with regards to this problem?
Thanks!
[att1.html]Hi Joe,
Attached is the config.xml for the domain that I'm working with. There are 3 connection
pools set-up.
The problematic Connection Pools are "MySQLCP" and "My JDBC Connection Pool"
Thanks for your help in this!
Joe Weinstein <[email protected]> wrote:
show us the pool definition, as it is in the config.xml file.
thanks
joe
Everbright wrote:
Hi,
I'm trying to do a simple connection to a MySQL database using theJNDI look-up
method.
Have tried this with the PointBase database that came with WebLogicand got it
to work successfully.
However got the attached error message when I tried it on MySQL database.I tried
this with both the WebLogic's driver for MySQL and also the one I downloadedfrom
MySQL (com.mysql.jdbc.Driver), and both failed with the same errormessage.
Offhand, it doesn't look like the connection pool is failing. Testedit with WebLogic's
"Test Pool" function and it was alright.
Also MySQL database is working properly. Test this by doing simpleconnection
and retrieval with simple JDBC connections and it works.
Any ideas what else I can check with regards to this problem?
Thanks!
Error 500--Internal Server Error
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:MyJDBCConnection Pool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
connectionPoolID=MyJDBC Connection Pool, dataSourceName=MyJDBC Data
Source}.
Nested Exception: java.lang.RuntimeException: Failed to Generate WrapperClass
at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:141)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:73)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
at jsp_servlet.__index._jspService(__index.java:142)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
at jsp_servlet.__index._jspService(__index.java:142)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
[config.xml] -
ERROR MESSAGE WHEN DISPLAYING LARGE RETRIEVING AND DISPLAYING LARGE AMOUNT OF DATA
Hello,
Am querying my database(mysql) and displaying my data in a
DataGrid (Note that am using Flex 2.0)
It works fine when the amount of data populating the grid is
not much. But when I have large amount of data I get the following
error message and the grid is not populated.
ERROR 1
faultCode:Server.Acknowledge.Failed
faultString:'Didn't receive an acknowledge message'
faultDetail: 'Was expecting
mx.messaging.messages.AcknowledgeMessage, but receive Null'
ERROR 2
faultCode:Client.Error.DeliveryInDoubt
faultString:'Channel disconnected'
faultDetail: 'Channel disconnected before and acknowledge was
received'
Note that my datagrid is populated when I run the query on my
Server but does not works on my client pcs.
Your help would br greatly appreciated here.
Awaiting a reply.
RegardsHello,
Am using remote object services.
USing component (ColdFusion as destination).
Maybe you are looking for
-
can you help me?Please
-
The new hard drive is in - now what?
Hi everyone, Please bear with me. I've suddenly become possessed by the idea of taking apart a Mac and putting new stuff in there. I am a complete novice in this respect, but I figure everyone has to start somewhere, right? I've got an iBook G3 Clams
-
Mail Alert to Managing Director for every transaction for customer & vendor
Dear Gurus, Please let me know how & where to do setting for mail alert to Managing Director for every transaction for customer & vendor, Like for Customer: Sales Order, PGI, Invoice, Payment receipt................ for Vendor: Purchase Order,
-
Simplest was to make a calendar
I am not sure if this is the right forum to ask this question, so don't flame me if I'm wrong. How can I make a simple calendar using iWorks '08 or iLife '08 with a photo, a title, and the actual calendar. I am not an artist, so if this is simple, do
-
How would you recomend calling it from XI?Can i convert it to RFC for XI?