Re: [PHP-DB] Select Value with 's

2003-11-06 Thread pete M
why the backticks and not quotes ? pete Ma wrote: hi! do not quite understand your problem.. pls post some code? heres a small snippet that should work well... $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; $res = mysql_query($qry); while($customer = mysql_fetch_object($r

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread CPT John W. Holmes
From: "pete M" <[EMAIL PROTECTED]> > > do not quite understand your problem.. pls post some code? > > heres a small snippet that should work well... > > > > $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; > > $res = mysql_query($qry); > > while($customer = mysql_fetch_object($re

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread Ignatius Reilly
SQL. Backticks force reading the string as a SQL object (db, table, column), as opposed to a string. Eg you could in theory have columns called "select" or "Mes Documents", and do: SELECT * FROM `select` AS S, `Mes Documents`AS MD ... of course it is wholly unadvisable to do so. Best to steer cl

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-06 Thread CPT John W. Holmes
From: "Boyan Nedkov" <[EMAIL PROTECTED]> > Putting more than one table in the FROM clause means tables are joined, > then at least following problems could arise: > > - using WHERE clause you can have empty recordset returned and then > COUNT conflicts with it because there is actually no any data

[PHP-DB] Apostrophe problem on Firebird

2003-11-06 Thread Evan Morris
This problem has probably already been solved (and may even already be a FAQ), but I can't find the answer and I've tried various things. I have data in a database that may contain apostrophes. I am passing variables from a form to a search facility. Essentially, I want a sql query that looks li

Re: [PHP-DB] Apostrophe problem on Firebird

2003-11-06 Thread CPT John W. Holmes
From: "Evan Morris" <[EMAIL PROTECTED]> > I have data in a database that may contain apostrophes. Some databases use the backslash character as an escape character for single quotes, while others use another single quote. Try your query such as: SELECT * FROM Table WHERE name = 'o''mallery' Ins

[PHP-DB] Searching a name field

2003-11-06 Thread Manuel Ochoa
I currently manage a MySQL database with about 3 records. I've given my users the ability to search the name field by pattern. For example, the name field can hold 36 characters and contains first name, middle initial and last name. example: NAME John D Miller Jr. Harry B Davis Angela De L

[PHP-DB] Re: Searching a name field

2003-11-06 Thread Chris Berlioz
Yes you have to break this up into fields that hold your Firstname, MI,Lastname. This has so many advantages, using PHP string function to query inside fields might be useful somewhere else, I wouldn't recommend it for use in a large DB. Divide and conquer! Espero este consejo te sirva, ese erro

[PHP-DB] Query or code?

2003-11-06 Thread Peter Beckman
I have this data: Table Log: appid userid points datetype Table Score: appid userid score I want to verify that the last entry in table log of type "x" is equal to the sum of the scores in table score for the same appid and userid. Can I do this in SQL easily? My problem is selec

[PHP-DB] RE: Problem

2003-11-06 Thread Jeremy Shovan
I was able to get rid of the parse error, but what I saw causing the error was a little strange. All I did was delete the spaces between your if statement and the bracket that follows ie. if( not if ( The next thing that I did was rewrote the line that says 'echo "Open";' although I didn’t change

Re: [PHP-DB] RE: Problem

2003-11-06 Thread CPT John W. Holmes
From: "Jeremy Shovan" <[EMAIL PROTECTED]> > All I did was rewrite it exactly the same as it was and the > parse error disappeared. I have never seen anything quite > like this before. Seen this before. It's either the editor or a copy and paste operation adding weird "invisible" characters. Major

Re: [PHP-DB] Query or code?

2003-11-06 Thread CPT John W. Holmes
From: "Peter Beckman" <[EMAIL PROTECTED]> > I have this data: > > Table Log: appid userid points datetype > Table Score: appid userid score > > I want to verify that the last entry in table log of type "x" is equal to > the sum of the scores in table score for the same appid and us

Re: [PHP-DB] Query or code?

2003-11-06 Thread beckman
On Thu, 6 Nov 2003, CPT John W. Holmes wrote: > From: "Peter Beckman" <[EMAIL PROTECTED]> > > > I have this data: > > > > Table Log: appid userid points datetype > > Table Score: appid userid score > > > > I want to verify that the last entry in table log of type "x" is equal to > >

Re: [PHP-DB] Query or code?

2003-11-06 Thread John W. Holmes
[EMAIL PROTECTED] wrote: On Thu, 6 Nov 2003, CPT John W. Holmes wrote: From: "Peter Beckman" <[EMAIL PROTECTED]> I have this data: Table Log: appid userid points datetype Table Score: appid userid score I want to verify that the last entry in table log of type "x" is equal to the sum

[PHP-DB] BBEdit

2003-11-06 Thread Jacob Hackamack
I use BBEdit on Mac OSX, I know I copied and pasted some things, but I actually wrote all of the lines that you took out, weird. I really have no idea how its screwing up on spaces like that, I wish there was a PHP error checker that actually told you what happens and why. Anyways, the beta of th

Re: [PHP-DB] BBEdit

2003-11-06 Thread George Patterson
On Thu, 06 Nov 2003 17:38:00 -0800 Jacob Hackamack <[EMAIL PROTECTED]> wrote: > I use BBEdit on Mac OSX, I know I copied and pasted some things, but I > actually wrote all of the lines that you took out, weird. I really > have no idea how its screwing up on spaces like that, I wish there was > a

Re: [PHP-DB] Query or code?

2003-11-06 Thread Peter Beckman
On Thu, 6 Nov 2003, John W. Holmes wrote: > I'd still like an answer to this question. Why is there a need for a > separate table with scores? The log is a "snapshot" in time -- what was the "total points" at the time of the log entry. The score table is always the accurate current score. >