473,378 Members | 1,334 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,378 software developers and data experts.

Select from table where field = string

How to select all lines containg a string (located in $pastmove) in the
moves column

I tried several ways, for example:

$requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastmove."%'";

but did not succeed;

Thqnks for your help
Jul 16 '05 #1
6 5146
> $requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastmove."%'";

try `` insted ''.

yours, dreamguard.
Jul 16 '05 #2
what do you mean by "insted" ?
Jul 16 '05 #3
I tried this

$requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastm."%'";

The whole table, i.e. all rows are selected, not only the ones with the
content of $pastm in moves column

Jul 16 '05 #4
Michel wrote:
How to select all lines containg a string (located in $pastmove) in the
moves column

I tried several ways, for example:

$requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastmove."%'";

but did not succeed;
I can't see anything at all wrong with this. If it is selecting _all_
records as your later post suggests, then check to see if there is a
value in $pastmove. If $pastmove is empty then:
...WHERE moves LIKE '%%'
will select everything.
Thqnks for your help


--
MeerKat

Jul 16 '05 #5

On 24-Aug-2003, "Michel" <Mi**************@wanadoo.fr> wrote:
How to select all lines containg a string (located in $pastmove) in the
moves column

I tried several ways, for example:

$requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastmove."%'";

but did not succeed;


Your select statement looks correct.

Can you be more specific-- how did it not succeed?

Did the query fail? What was the error message? (You are reporting the error
messages, right?)
If the query worked, did it return the wrong rows? too many rows, etc.

Are you sure your table definition is correct and the column names are
spelled correctly? Are you sure $pastmove contains a value?
--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #6
Michel wrote:
I tried this

$requete="SELECT moves, opening_id FROM suitemove where moves like
'%".$pastm."%'";
$pastm or $pastmove?
The whole table, i.e. all rows are selected, not only the ones with the
content of $pastm in moves column


--
MeerKat

Jul 16 '05 #7

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

Similar topics

4
by: R.G. Vervoort | last post by:
Does anyone have a suggestion how I can order a list with names in a secondary select string. The first string selects a number of locations where people work From this string I get...
3
by: Nick Douglas | last post by:
I have a table with 50 fields, and a combo box which is set to 'field list' to read the field names. I want to select report groups via another combo box based on the field names the user selects....
5
by: freddy | last post by:
I have a select statement like this: string Select = "Select TableofContents, DataOwner, Delegates From NYC"; and it work fine, but if I was to put a space in like this: string Select = "Select...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
3
by: Billy | last post by:
I do a SELECT * from table command in an ASP page to build a text file out on our server, but the export is not to allow a field name rows of records. The first thing I get is a row with all the...
1
by: Billy | last post by:
I do a SELECT * from table command in an ASP page to build a text file out on our server, but the export is not to allow a field name rows of records. The first thing I get is a row with all the...
1
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just...
28
by: Rickster66 | last post by:
This thread is similar to the thread (Select only 10 columns going back) that I posted regarding the dynamic selection of data going back one month at a time for 12 months. Here is the qiote fron...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
1
by: KrazyKasper | last post by:
Access 2003 – Multi-Column List Box – Select Multiple Items I have a multi-column (3 columns) list box that works well to select one set of records or all sets of records (based on the first field...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.