473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unknown parse error

I get a strange parse error in the following lines.
Can anyone see what I don't.

//Query the Database
$query = "SELECT type FROM `map`
WHERE map_file = " . $_SESSION['new_map'] . "
AND col = " . $_SESSION['new_col'] . "
AND row = " . $_SESSION['new_row']
$db_result = mysql_query($query);
$db_cell_type = mysql_fetch_array($result);

Any help is greatly appreciated.
Jul 17 '05 #1
2 1812
"Ph47f3" <bt**@snowhill.com> wrote in message
news:14**************************@posting.google.c om...
I get a strange parse error in the following lines.
Can anyone see what I don't.

file://Query the Database
$query = "SELECT type FROM `map`
WHERE map_file = " . $_SESSION['new_map'] . "
AND col = " . $_SESSION['new_col'] . "
AND row = " . $_SESSION['new_row']
$db_result = mysql_query($query);
$db_cell_type = mysql_fetch_array($result);


You forget to write ';' at the end of AND row = " .
$_SESSION['new_row']

--
Wishes, Rostik Kerey
Jul 17 '05 #2
Ph47f3 wrote:
I get a strange parse error in the following lines.
Can anyone see what I don't.

//Query the Database
$query = "SELECT type FROM `map`
WHERE map_file = " . $_SESSION['new_map'] . "
AND col = " . $_SESSION['new_col'] . "
AND row = " . $_SESSION['new_row']
$db_result = mysql_query($query);
$db_cell_type = mysql_fetch_array($result);

Any help is greatly appreciated.


I betcha you're getting an "Unknown column 'x'" error, right? Try
surrounding your variables in quotes like so:

$query = "SELECT type from `map`
WHERE map_file = '$_SESSION[new_map]'
AND col = '$_SESSION[new_col]'
AND row = '$_SESSION[new_row]'";

-Jay

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Moore | last post by:
Hello I am using the System.DirectoryServices namespace classes to access Active Directory. We connect using the LDAP://DOMAIN method. The code works on local dev boxes, and in staging, but...
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
3
by: Lance | last post by:
Hi, Sorry for the confusing subject, but here is what I am after: I am using the 'System.Drawing.FontStyle' object, and I would like the caller of the function to be able to decide when calling...
0
by: Mike | last post by:
I am new to ASP.NET and was looking to some code for implementing page templates. When opening the ascx, I see an error in the design pane saying: "Parse error: Unknown server tag...
1
by: Benign Vanilla | last post by:
Working on an ASP.NET project recently, I was trying to put a customer control into use, and kept receiving this error: Description: An error occurred during the parsing of a resource required to...
0
by: Paul | last post by:
Hi all, I'm trying to deploy a small website that has a couple of custom controls. This works fine locally, but falls over with an "Unknown server tag" error when trying to parse the custom...
2
by: Calvin Cheng | last post by:
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1)...
23
by: Himanshu Chauhan | last post by:
Hi! I was wondering, In the first parse of a singly linked list of unknown length, is it possible to know when we are at middle of the linked list? Regards --Himanshu
1
by: Gramma2005 | last post by:
I am trying to connect to an access db through php on Windows Server 2003 running XAMPP. The code I am using has worked before on another access db on this server so I am not sure what is causing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.