Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Error In Syntax For Search Results


echo "<p><strong>".($i+1).". Login: ";

I get the following error returned when doing a syntax check

PHP Parse error: parse error, unexpected '>' in c:wayne
esults.php on
line 37

I am using the SAMS PHP and Mysql Web Development book's example on
page 231




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results.

I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:

Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?

Email Script/Javascript Parse Error: Syntax Error, Unexpected T_STRING
I've made a email script to include javascript. Now what I want to do, is that I want to hide the link in status bar when I hover over it. I've implemented javascript into the code but I keep getting the following error:

Parse error: syntax error, unexpected T_STRING in /home/****/public_html/fbmail/contact.php on line 12

Here is line 12:
$message .= '<a href="http://www.mysite.com/" onMouseOver="window.status='Click here to continue.'; return true;" onMouseOut="window.status=''; ">Click here to continue ..</a>'; The complete code:

Parse Error: Syntax Error, Unexpected T_ENCAPSED_AND_WHITESPACE, Expecting T_STR
I am having troubles entering this info into my db. Cna someone help? This is the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/realfina/public_html/ec/testdobaapi.php on line 22 Code:

Parse Error: Syntax Error, Unexpected '?' In /home/**/public_html/website_
Parse error: syntax error, unexpected '?' in /home/realfina/public_html/website_builder/phpcb/filgen.php on line 373

Can someone explain what this means?

Highlighting Of A Search Term In Search Results
I am writing this simple MySQL and PHP search and what I want to do is to highlight the search term in the results when they are displayed on the screen.  I am able to get it to work. but the seach term will only be highlighted(Make it Bold) only if it matches exactly to what was typed in the search box. 

Is there a way where the search term doesn't have to exactly match in order for it to be highlighted?  Below is the code where I change the the search term into bold to be displayed on the screen.

<?php
$result_manufact = str_replace($splitstr, "<span style="color: red; font-weight: bold;">$splitstr</span>", $manufact);
?>

Parse Error: Syntax Error, Unexpected T VARIABLE In
I can't figure this out I am posting the script as well if you see something wrong please send an email.

=====================================
<?php
$nume = $_POST['nume']
$prenume = $_POST['prenume']
$adresa = $_POST['adresa']
$telefon = $_POST['telefon']
$mobil = $_POST['mobil']
$A = $_POST['A']
$B = $_POST['B']
$C = $_POST['C']
$CE = $_POST['C+E']
$D = $_POST['D']
$zi = $_POST['zi']
$luna = $_POST['luna']
$an = $_POST['an']
$email = $_POST['email']
$comentarii = $_POST['comentarii']
$ip = getenv("REMOTE_ADDR");

$msg = "Nume: $nume
Prenume: $prenume
Adresa: $adresa
Telefon fix: $telefon
Mobil: $mobil
Categoria A: $A
CategoriaB: $B
CategoriaC: $C
CategoriaC+E: $CE
CategoriaD: $D
Data Nasterii: $zi-$luna-$an
IP: $ip";
$to = "email@example.com";
$subj = "candidat nou";
$from = "www.example.com";
mail ($to, $subj, $msg, $from);
header("Location: success.htm");
}
?>
===================================
error is Parse error: syntax error, unexpected T_VARIABLE in D:xampphtdocsestauto schoolsite_flashsend.php on line 4

Parse Error: Syntax Error, Unexpected T_OBJECT_OPERATOR
I got following error:

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /xxx/xxx/public_html/xxxx/GeteBayOfficialTime.php on line 49

what's wrong with my syntax? GeteBayOfficialTime.php required be runned at PHP 5.x.x., but my web host said support php 4.4.4. I don't know whether I got error because this reason. Code:

Parse Error: Syntax Error, Unexpected $end In C:wampwwwsitescismv1
I keep getting a "Parse error: syntax error, unexpected $end in c:wampwwwsitescismv1contacts.php on line 227". Line 227 is the end of my code. From what I can tell from searching the web, it appears that there is something that is not concantenated correctly. I cannot find it though. Can anyone else see it?

Or Syntax For Directory Search
We use a script written in PHP that uses a simple ls command to
identify files typed into a form. Our directory structure includes
either a one or two steps away from public directory location of
files, in other words, either

1. [DIR]/[file].[ext] or
2. [DIR]/[DIR]/[file].[ext]

current syntax

.../*/$[variable].[ext]

stops at 1 and fails to find files in 2

I modified as follows

.../*{1,2}/$[variable].[ext]
or
.../*+/$[variable].[ext]

without success.

Anyone know the right regular expression syntax for PHP to properly
configure script to look for a possible subdirectory prior to
determining whether or not a file type exists or not?

Parse Error: Syntax Error, Unexpected $end In ..
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.

Is there an easy way to determine where the inital " started? I find
myself adding /* */ blocks or cutting/pasting sections of code out in
order to find where the error occured.

Wouldn't it it be nice if the warning message included the line in teh
source where the initial quote occured?

for example say this is my code
<?
function Build_Query(....)
code...

$my_query = "SELECT BLAH FROM ; (line 15)

more code...

} (line 100)
EOF

and you got

Parse error: syntax error, unexpected $end in MYFILE on line 100
started on line 15

Error Performing Query: You Have An Error In Your SQL Syntax Near
I have a query which pulls user info from a database table, and displays it in an HTML table. The user then has the ability to edit this data on the next page by clicking continue, where the first and last name are passed as variables, and are listed as uneditable, whereas all the other fields are able to be edited through a simple form.

Here's my problem, on the final page where the actual database UPDATE occurs, I'm getting a SQL error that looks like this
---------
Error performing query: You have an error in your SQL syntax near 'WHERE first_name='Joe' AND last_name='Schmoe' SET street_address_1='real address' at line 1
----------

It looks like its passing the first and last name fine (through hidden inputs), yet when I start to pass the edited fields as variables, it cuts off for some reason. The actual full value that I entered for "street_address_1" was "real address 333". It looks like it cut off after the "address", and didnt even bother to send the other 8 fields.

My code on the processing page looks like this
----------
$street_address_1_update=$_POST['street_address_1_update'];
$street_address_2_update=$_POST['street_address_2_update'];
$city_update=$_POST['city_update'];

$sql ="UPDATE mailing_list WHERE first_name='$first_name_update' AND last_name='$last_name_update' SET street_address_1='$street_address_1_update' street_address_2='$street_address_2_update' city='$city_update'"
----------
I only included 3 fields for brevity's sake. The rest pass the same way as these three. Again, the first and last names are simply passed as hidden inputs through the form.
Anybody have any clue what might be causing this? I know the error is a SQL one, but I may not be passing the variables correctly in PHP.

Redirect Error Reported As SQL Syntax Error
I just spent way too much time trying to track down an error that was incorrectly reported just now, and I would like to see if someone can explain to me why it was reported that way.

The purpose of the code is simply to delete a record and then redirect back to the page where the delete was started. The code looks like this:

elseif ($_GET[action] == "delete")
{
$query = "delete from product_subcategory2 where product_sku=$_GET[product_sku] and subcategory2_id=$_GET[subcategory2_id]";
$result = mysql_query($query) or die (mysql_error());
$affected_rows = mysql_affected_rows();

if ($affected_rows == 1)
{
header("Location:product.php?action=edit&product_sku=$product_sku");
}
else
{
do_header();
echo("<center><p class="body">Unable to delete Subcategory2. Please try again.</p>");
echo("<a href="product.php?action=edit&product_sku=$product_sku">Edit Product</a>");
do_footer();
}
}

The SQL was find, but the error I had was in the header line. What I had was this:

header("Location:product.php?action=edit&product_sku=<?php echo $product_sku?>");

so since I was already in PHP, I didn't need the "<?php echo" for $product_sku.

Parse Error: Syntax Error, Unexpected
Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/hawkwebd/public_html/buy.php on line 2
what does this mean

Parse Error: Syntax Error ?
Does anyone know what this means? The file it is saying user.php is a class file however i think i got all the opening and closing braces.

QuoteParse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /*/*/*/*/includes/user.php on line 10

Syntax Error
Is it possible to use both Where and Order by in the same statement. Im pretty sure you can but i cant seem to get hte syntax right. Bewlos is the line im refering to:

$qry = "SELECT * FROM `$table` order by `$_GET[sortby]` desc limit $StartFrom, $Limit" WHERE `username` = "'.$session->username.'"'

Syntax Error?
Why does the following line create a Syntax error in PHP.

$Mac = ( (strstr($query,'Mac') || (strstr($query,'Mc') ||
(strstr($query,'M ') );

Syntax Error ???
on login.php , we can see that :

(...)

$sql = "SELECT Login FROM logins
WHERE Login='$fusername'";
$result = mysql_query($sql)
or die("Couldn't execute query1.");

(...)

field : login from table: logins

fusername is a valid form field.

I just can't understand why I get the message Couldn't execute query1.
I don't see any syntax error. :-(



SQL Syntax Error
Where is the error?

mysql_query("INSERT INTO list (status) VALUES ('$status') WHERE name = $name")or die(mysql_error());

Error In Your Sql Syntax
Could not run query: 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 'character WHERE name = 'Chris" at line 1

Im getting this error with this code. I think the problem is... 'Chris"  (part in bold), but I can't fix it. Code below where error occures.

$result = mysql_query("SELECT guid FROM character WHERE name = '".$user."'");

I Get A Syntax Error Unexpected '>
Can someone please take a look a this code and give an idea what i'm soing wrong. I;m trying to deleate a record but I can do it.

<?
//session_start();
include_once("mysql_connect.php");
$myConn = connect_db();

$serviceid = $_POST['serviceid'];

$delete = mysql_query("DELETE * FROM service WHERE service_id = $serviceid);

mysql_query($strSQL, $myConn) or die (mysql_error());
echo "<script>alert('" . $intIndex . " Service Deleted!');</script>";
echo "<script>location.href='mycar.php'</script>";

?>

I get a syntax error unexpected '>'

Mysql / PHP : Syntax Error
for php syntax when i call Mysql database

I have wrote that and my sql connection is working

I just have a problem with this command line :

$query = "SELECT * FROM utilisateurs WHERE
pseudo_utilisateur='$login'";
$acces = mysql_query($query);

Syntax Error In Header...
Hi I am getting a sytax error in the following code but I cannot seem to find the problem.. Can anyone see where I am going wrong? PHP Code:

< In ' ' And PHP Shouts About Syntax Error :(
I`ve got a problem again:(
I almoust finished my project and I was doing stupid forms in html to display as
frontend. I have something like that:
<?php
$wyswietl[] = '
<html>

and php shouts:

<b>Parse error</b>: parse error, unexpected '<' in <b>D:IncomingWWWetak.pl
developer_d
isplay.inc</b> on line <b>3</b><br />
:((
I was sure that a variable can have >1 lines

You Have An Error In Your SQL Syntax; (@ Symbol?)
I'm getting this error at the mo... not overly useful... Is there a problem with the @ symbol?

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 '@hotmail.com' at line 1

Mysql Syntax Error
what is wrong with this statemnet: $query = 'SELECT * FROM products WHERE id = '.$id.' AND boy = '.$boyGirl.' OR girl = '.$boyGirl; what do i do to fix it?

SQL Syntax Error With PHP Variables
I'm getting the following error:

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 'div, writer, sme, progress, status, due) VALUES (Test Project,test description,t' at line 1

Based on this code:

Not Showing Syntax Error
I have a prb that when i run any web page and if it contains an syntax error. then nothing is displayed. I mean page is blanked. what need to change in php.ini.

Is This Possible With Search Results
Is it possible that when someone does a search on your database, that the results are downloaded as a text file?

Is Anyone Else Able To See My Search Results?
Here is the thing. When you go to this page:

http://www.accumulist.com/index.php...llFields%5D=api

I've put in some HR tags in the HTML to separate the 3 different
queries. After those 3 queries you'll see results at the bottom. For
me, those results look like this:

api (4), darren (1), xml (12), battlepanda (1), war+on+drugs (6),
stupid (1), moron (1), nightmare (1), hell (1), mijkuynbvfsds (1),
police (1), Pitchfork+Media (1),

There are two problems here. Do you get this when you go to this page?
I'm concerned that I'm only getting back the things that I have
personally searched for, and not the things that others have searched
for. Let me know, please, if this works for you.

The goal of this script is to be able to say to the person who is
searching "People who searched for this item, also searched for these
other things."

It is suppose to be a little like on Amazon.com, where when you buy one
thing, it says "Customers who bought this item also bought these other
items:".

I'm sorry I didn't give the table structures earlier. The visitor id of
searchHistory is the id of visitors. machineId is a unique value
generated and set by a cookie.

#
# Table structure for table `searchHistory`
#

CREATE TABLE `searchHistory` (
`id` int(11) NOT NULL auto_increment,
`query` text NOT NULL,
`visitorId` int(11) NOT NULL default &#390;',
`domain` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=88 ;

#
# Table structure for table `visitors`
#

CREATE TABLE `visitors` (
`id` int(11) NOT NULL auto_increment,
`date` int(11) NOT NULL default &#390;',
`ipAddress` varchar(15) NOT NULL default '',
`hostname` varchar(255) NOT NULL default '',
`machineId` varchar(255) NOT NULL default '',
`referrals` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=8236 ;

Search Results
whenever i do a $result-$row query and try to list the results with a while statement, it always cuts off the first result. how do i fix this?

Syntax Error Using Register Globals
Hi. Everytime I try and use these globals like this:

Trouble With UPDATE - You Have An Error In Your SQL Syntax
I'm having some trouble getting my database to update. This is my first attempt at PHP and MySQL and so far I'm doing well. I just used some of the code from the tutorials on this site and changed them to suit my needs. Everything works except updating the database. Clicking edit swaps a row in a table with a form that should allow me to update the entry. Here is the error it throws.

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 '' at line 3
I have followed the correct syntax as far as I can tell, but like I said, this is my first time with PHP and MySQL. Following is all my code (minus CSS which has nothing in it really) with the appropriate sections highlighted.

Code:

Syntax Error, Unexpected T_STRING
Parse error: syntax error, unexpected T_STRING in C:...

Here is the script ....

Page Last Updated Syntax Error
I tried embedding this in an XHTML file, then changed it to a
last4.php, but get a syntax error. What am I doing wrong?

<?php
$last_modified = filemtime("last4.php");
print("Page Last Updated: ");
print(date("m/j/y h:i", $last_modified));
?> ...

Last Date Updated Syntax Error
I tried embedding this in an XHTML file, then changed it to last4.php,
but get a syntax error. What am I doing wrong?

<?php
$last_modified = filemtime("last4.php");
print("Page Last Updated: ");
print(date("m/j/y h:i", $last_modified));
?>...

Syntax Error Cannot Found Out Solution
I encounter syntax error with this line:
<option <?php if( $rows1['rig_name'] ==?>" <?php echo $rows1['rig_name']; ?>" <?php ) { print "selected"; }?> value="<?php echo $rows1['rig_name']; ?>"><?php echo $rows1['rig_name'];?></option>

Parse error: syntax error, unexpected '' in C:PortableWebApprogramwwwlocalhostdrillcorpmaster_adminprojectupdate_projectupdate.php on line 53 PHP Code:

Newbie Questions-- Syntax Error
I keep getting errors on certain pages. Where should I look for changes?

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
'select a.*, pd.products_name from affiliate_clickthroughs a
select count( select a.*, pd.products_name from affiliate_clickthroughs a
left join products p on (p.products_id = a.affiliate_products_id) left join
products_description pd on (pd.products_id = p.products_id and
pd.language_id = &#391;') where a.affiliate_id = &#391;' ORDER BY
a.affiliate_clientdate desc ) as total
[TEP STOP]

Cannot Parse Php In Browser, Syntax Error
I'm getting started with PHP, and I'm got a simple database in MySQL and using php to display information from it. I have a script where I'm trying to display the following:

-first name
-last name
-address

When I parse the file with VIM, I get a syntax error line 20, but I'm not able to see/find my error. PHP Code:

Syntax Error, Unexpected ')', Expecting '(' In
I am getting this error:
Parse error: syntax error, unexpected ')', expecting '(' in /home/realfina/public_html/tests/cvlsofttest/alert.php on line 27

//line 27
$this->V91c7ec= new GtkDialog('Prompt', null, Gtk::DIALOG_MODAL);

Links From Search Results
Hi i was wondering if anybody could tell me how to make url links to an item in my site from a list of search results. Here is a piece of my code:

<?php
$Name = $HTTP_POST_VARS["query2"];
$Eventtype = $HTTP_POST_VARS["query2"];
$EventStart = $HTTP_POST_VARS["query2"];
$EventEnd = $HTTP_POST_VARS["query2"];
$VenueName = $HTTP_POST_VARS["query2"];
if($Name or $Eventtype or $EventStart or $EventEnd or $VenueName)
{

$conn=@mysql_connect("mysql", "u0rr")
or die("Sorry can't connect to database");

$rs = @mysql_select_db("u0rr", $conn)
or die("Sorry can't connect to database");

$sql="select * from event left join venue on
(event.VenueID = venue.VenueID)
where (Name like '%$Name%'
or VenueName like '%$VenueName%')
AND Eventtype = 'Comedy' ";
$result=mysql_query($sql,$conn);

while( $row = mysql_fetch_array($result) )
{
echo("<b>"." Event Name: "."</b>".$row["Name"]."<br>");
echo("<b>"." Event Type: "."</b>".$row["Eventtype"]."<br>");
echo("<b>"." Venue Name: "."</b>".$row["VenueName"]."<br>");
echo("<b>"." Event Start: "."</b>".$row["EventStart"]."<br>");
echo("<b>"." Event End: "."</b>".$row["EventEnd"]."<br>");
echo("<b>"." Availability: "."</b>".$row["Availability"]."<br>");
echo("<b>"." Description: "."</b>".$row["Description"]."<br><hr>");
}
}
?>
For example if i enter an event type as 'comedy', a list of search results will come up from the form input displaying comedy events. Now from these results i would like to be able to click on Venue Name and this would link to that page in another part of my site.

I hope this explanation is o.k, if not post a thread & i'll try and explain a bit better. Thanks for any help

How Do I Underline My Search Results?
This is a PHP/MySQL question.

I have a search engine that finds matches of a word in artist names, and their album titles. How do I underline the word that is matched when I display the results? I've seen this on Yahoo! and was wondering how to do it.

Multiple Search Results
I have a php script which searches a mysql database and returns and lists the results 25 records per page. I am using the offset to do this. It works well. But I am outputing the search results 1 record per line, 25 records per page, with links to the previous and next pages, etc.

What I really want is to list the results in a 5 X 5 table. ie the first 5 records on table row 1, the next 5 on table row 2, etc.

Obviously for the last page there may not be 25 records, but anything from 1 to 25.

How can I automatically output html to produce the table and populate each cell with a record from the search result?

Links From Search Results
i was wondering if anybody can tell me how to make a url link to another part of my site from a completed search result. here is a section of my code i would like to link from.

echo("<b>"." Name: "."</b>".$row["Name"]."<br>");

Printing Search Results
How would I go about printing a list of search results? I have my query down fine:

<?php
$query = "SELECT data1, data2 FROM table WHERE name = '%$var%' ";
$result = mysql_query($query);
?>

I need to know what to do after this so that all results are printed in a table that includes 'data1' and 'data2'. I'd imagine this is done using 'while()' loops but I've never worked with one before and especially not in this context.

Search Results Substring
I have been searching for some clues as to how to show a substring from a
database search.

$pagetitle = "Page Title";
$pagetext = "This is <b>a typical</b> string that would be stored<br>in the
database.";

Search for "that" results would look like

1. Page Title
...string that would...
2. Another page
...computers that can...
3. Further Page
...languages that are...

At the moment the search results just show the page title. The idea is that
in the set of results I can show the user the context of each result, a bit
like a search engine does. Ideall I would like up to 10 words either side
of the search keyword.

Counting Search Results
I would like to know if anyone can show me how to count search results in a MySQL database for a keyword ($keyword).

Posting Search Results
i am a bit stuck on this part of coding, when people search ALL categories i leave the option value as: <option value="0"> so if 0 is passed to the GET all categories should be searched instead of just category 1,2 or 3 etc Code:

Search Results Pagination
I have problem with results pagination. When search is applied browser is showing me first 10 results, and links to other pages, but there is a problem with these links (passing variables i think). When i press on one of the links browser is showing me info that search input must be longer then 2 char. (so it clear that search input has not been passed thru the link. Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved