Re: [PHP-DB] SQL very fast here & very slow there

2003-01-24 Thread Brent Baisley
I'm not sure how Paradox works, but it may be locking problems you are running into. I know Paradox used to have issues with data changing while a query was executing. On your home machine you are the only one accessing the DB, so there wouldn't be any contention. Your home DB probably hits the

[PHP-DB] SQL very fast here & very slow there

2003-01-24 Thread Paolo Bonavoglia
I have realized a php web page with this "heavy" SQL query, necessary to show a list of students: $sqlcom = "SELECT Alunni.Cod_Alunno, Nome, Cognome, Scritto, Orale, Assenze FROM Alunni, Scrutini, Iscritti WHERE Alunni.Cod_Alunno = Scrutini.Alunno AND Scrutini.Alunno = Iscritti.Cod_Alunno AND

[PHP-DB] SQL Error

2002-12-06 Thread Daniel
Please help. I have a basic scipt: $connection_id=odbc_connect("$DSN","$user","$pass"); $sql="select * from whatever"; $stmt=odbc_prepare($connection_id,$sql); $result=odbc_execute($connection_id,$stmt); this script used to work on RH-7.3 with php-4.1.2 the script will not work anymore when i ins

RE: [PHP-DB] SQL Guru Question:

2002-11-26 Thread Snijders, Mark
don't think it won't work all in mysql... but what db are we talking about? Well, have you tried it like that? If that doesn't work you could try this: select @calc:=(round(pr_contents * 12)+ round(pr_buildings * 12)), (@calc * .33) as agent, (@calc * .5) as manager from pipeline Regards Joakim

Re: [PHP-DB] SQL Guru Question:

2002-11-26 Thread Joakim Andersson
Pete wrote: I'm trying to write a query to update the comission calculations on a database The sql looks something like select (round(pr_contents * 12)+ round(pr_buildings * 12)) *.33 as agent, (round(pr_contents * 12) + round(pr_buildings * 12)) * .5 as manager, from pipeline if there a way

[PHP-DB] SQL Guru Question:

2002-11-26 Thread Pete
I'm trying to write a query to update the comission calculations on a database The sql looks something like select (round(pr_contents * 12)+ round(pr_buildings * 12)) *.33 as agent, (round(pr_contents * 12) + round(pr_buildings * 12)) * .5 as manager, from pipeline if there a way of having a "

RE: [PHP-DB] sql select

2002-11-12 Thread Steve Dodkins
Top man!! Many thanks Steve -Original Message- From: [EMAIL PROTECTED] [mailto:epeloke@;echoman.com] Sent: 12 November 2002 16:02 To: Php-Db (E-mail) Subject: RE: [PHP-DB] sql select I don't think you can reference the aliased column timea in the select clause, I know sql server

Re: [PHP-DB] sql select

2002-11-12 Thread Adam Williams
Have you ran it by hand in MySQL from the command prompt with some test data and gotten an error? Adam On Tue, 12 Nov 2002, Steve Dodkins wrote: > if i have a statement > > $result = mysql_query("SELECT > labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_

RE: [PHP-DB] sql select

2002-11-12 Thread Edward Peloke
2, 2002 10:16 AM To: Php-Db (E-mail) Subject: [PHP-DB] sql select if i have a statement $result = mysql_query("SELECT labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works _orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS timea FROM labor,

[PHP-DB] sql select

2002-11-12 Thread Steve Dodkins
if i have a statement $result = mysql_query("SELECT labor_id,labor_ord_no,labor_wkyr,works_orders_part_no,works_orders_qty,works _orders_customer_id,labor_qty,labor_time,labor_qty*parts_time+parts_setup AS timea FROM labor,works_orders,parts WHERE labor_ord_no=works_orders_ord_no AND works_orders

Re: [PHP-DB] SQL file,

2002-09-21 Thread John Coder
rough with a sql query? > > > > -Bryan > > - Original Message - > > From: "Brad Bonkoski" <[EMAIL PROTECTED]> > > To: "Bryan McLemore" <[EMAIL PROTECTED]> > > Cc: "PHP DB LIST" <[EMAIL PROTECTED]> > > S

Re: [PHP-DB] SQL file,

2002-09-21 Thread Brad Bonkoski
IL PROTECTED]> > To: "Bryan McLemore" <[EMAIL PROTECTED]> > Cc: "PHP DB LIST" <[EMAIL PROTECTED]> > Sent: Saturday, September 21, 2002 8:18 AM > Subject: Re: [PHP-DB] SQL file, > > > Typically, it is a text file that has SQL in it. > > Like

Re: [PHP-DB] SQL file,

2002-09-21 Thread Bryan McLemore
So I would send the file through with a sql query? -Bryan - Original Message - From: "Brad Bonkoski" <[EMAIL PROTECTED]> To: "Bryan McLemore" <[EMAIL PROTECTED]> Cc: "PHP DB LIST" <[EMAIL PROTECTED]> Sent: Saturday, September 21, 2002 8:18

Re: [PHP-DB] SQL file,

2002-09-21 Thread Brad Bonkoski
Typically, it is a text file that has SQL in it. Like: CREATE DATABASE some_name ( ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, NAME varchar(30), etc Usually they are used to store the database information, and can be used in many of the database systems. Within the database itself, there is

[PHP-DB] SQL file,

2002-09-21 Thread Bryan McLemore
in an example I saw in a book while I was leafing through it at barnes and nobles I saw a .sql file. It appeared to have the schema for a db in it. I was wondering what exactly what it is and how one could use it in a php application like he was doing. Thanks, Bryan

Re: [PHP-DB] SQL update help

2002-09-21 Thread Ignatius Reilly
IL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, September 21, 2002 2:07 AM Subject: Re: [PHP-DB] SQL update help > Jeffrey is right, but here's an easier way: > > $sql = "UPDATE $table SET pages = '$PHP_SELF' WHERE session = '$holy_cow'"; &g

Re: [PHP-DB] SQL update help

2002-09-20 Thread Dave Smith
Jeffrey is right, but here's an easier way: $sql = "UPDATE $table SET pages = '$PHP_SELF' WHERE session = '$holy_cow'"; Be sure you use double-quotes to build the string (so that all variables get interpolated) and single-quotes within. Any non-numeric value has to be quoted for an SQL stateme

Re: [PHP-DB] SQL update help

2002-09-20 Thread Jeffrey_N_Dyke
= $holy_cow hth jd "Jas" cc: Subject

[PHP-DB] SQL update help

2002-09-20 Thread Jas
Here is my statement UPDATE $table SET pages = $PHP_SELF WHERE session = $holy_cow However it will not update I recieve this error: You have an error in your SQL syntax near '/admin/login.done.php WHERE session = 5d44389bd70881131b9ea7573eba34d4' at line 1 Any help would be appreciated Jas --

RE: [PHP-DB] SQL newbie

2002-09-08 Thread Boaz Yahav
riginal Message- From: John W. Long [mailto:[EMAIL PROTECTED]] Sent: Friday, September 06, 2002 5:00 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL newbie Hi, I'm using the following statements to insert a record into a table: $SQL_Exec_String = "Insert Into Messages (ReplyID,Sub

[PHP-DB] SQL newbie

2002-09-07 Thread John W. Long
Hi, I'm using the following statements to insert a record into a table: $SQL_Exec_String = "Insert Into Messages (ReplyID,Subject,Sender,Email,Message,Reviewed) Values ($ReplyID,'$Subject','$Sender','$Email','$Message',$Reviewed)"; $cur = odbc_exec( $cnx, $SQL_Exec_String ); This works grea

Re: [PHP-DB] SQL Query

2002-09-06 Thread Adam Williams
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY Adam On Sat, 7 Sep 2002, Bryan McLemore wrote: > Hi Guys I have written this SQL Query : > > CREATE TABLE tasks (id INT AUTO_INCREMENT, name VARCHAR(50), desc TEXT, address >VARCHAR(50), startDate DATE, lastWork DATE, progress

[PHP-DB] SQL Query

2002-09-06 Thread Bryan McLemore
Hi Guys I have written this SQL Query : CREATE TABLE tasks (id INT AUTO_INCREMENT, name VARCHAR(50), desc TEXT, address VARCHAR(50), startDate DATE, lastWork DATE, progress INT(3)) I'm sending it in through php and I can't get it to work correctly. Please help. Also, I would like to make id

RE: [PHP-DB] SQL guru needed!

2002-08-20 Thread Russ
EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 4:13 PM To: Russ Subject: Re: [PHP-DB] SQL guru needed! Is TourCatID a table? you can't do that, this is a subquery Build first a string $string with all the values of TourCatID in it such as ('a', 'b', ...) And replace y

[PHP-DB] SQL guru needed!

2002-08-20 Thread Russ
Hiya folks: I wish to be able to select items from MySQL if a variable passed via the $_GET method to my PHP4 page is introduced thus: $sql = "SELECT TourName,TourID,$_GET[CatID] IN (TourCatID) FROM tour"; When I echo $sql to the page, the query looks fine but doesn't work, in as far as the wro

Re: [PHP-DB] SQL order by queries

2002-07-26 Thread Jason Wong
On Saturday 27 July 2002 15:03, Georgie Casey wrote: > Can you d arithmetic division on two fields in an ORDER BY?? > > eg > SELECT * FROM table_name ORDER BY field1 / field2 DESC > > Can it be done? Try: SELECT *, (field1 / field2) AS doo FROM table_name ORDER BY doo DESC -- Jason Wong -> G

[PHP-DB] SQL order by queries

2002-07-26 Thread Georgie Casey
Can you d arithmetic division on two fields in an ORDER BY?? eg SELECT * FROM table_name ORDER BY field1 / field2 DESC Can it be done? -- Regards, Georgie Casey [EMAIL PROTECTED] *** http://www.filmfind.tv Online Film Production Directory ***

RE: [PHP-DB] SQL query prob

2002-07-17 Thread Cal Evans
TED]] Sent: Wednesday, July 17, 2002 8:44 PM To: PHP DB Mailing List (E-mail) Subject: [PHP-DB] SQL query prob I'll try that one again I have a query: $sql = "SELECT * FROM contacts ORDER BY ContactType"; There are two types of contacts: * Commissioners * Staff As they a

[PHP-DB] SQL query prob

2002-07-17 Thread Russ
I'll try that one again I have a query: $sql = "SELECT * FROM contacts ORDER BY ContactType"; There are two types of contacts: * Commissioners * Staff As they are ordered by the ContactType then 'Commissioners' are displayed first followed by 'Staff'. I'd like to be able to display a h

[PHP-DB] SQL Solution??

2002-07-17 Thread Russ
Hi all: I have a simple MySQL SELECT query: Mr Russ Michell Web Applications Developer Itomic.com Email: [EMAIL PROTECTED] Tel: +61 (0)8 9321 3844 Fax: +61 (0)8 6210 1364 Post: PO Box 228, Innaloo, WA 6918, Australia Street: Suite 24, 158 William St, Perth, WA 6000, Australia "No proo

[PHP-DB] SQL mailing list

2002-07-09 Thread Casey Allen Shobe
Do any of you know of any good, general SQL discussion mailing lists? Preferably DB-independent. I'd like to find a place to ask SQL questions and get a human response... TIA, -- Casey Allen Shobe / Network Security Analyst & PHP Developer SecureWorks, Inc. / 404.327.6339 x169 / Fax: 404.728

RE: [PHP-DB] SQL prob (DATE_FORMAT)

2002-07-07 Thread Russ
ng List (E-mail) Subject: Re: [PHP-DB] SQL prob (DATE_FORMAT) Russ, I'm a bit of a novice, but I would have thought that the DATE_FORMAT function would only work if the field had been defined as a DATE field type. If you are storing the date as an integer eg: 20020705 (today), why not form

[PHP-DB] SQL question!

2002-06-27 Thread Bruno Gimenes Pereti
Hi, I need a sql query to join multiple lines into only one line. Ok, I wouldn´t understand this question so I´ll give an example (I´m doing it on mysql but I need it to mssql). Supose I have 3 tables: mysql> select * from test1; ++---+ | id| nome | ++---+ | 1| Bruno

Re: [PHP-DB] sql standard

2002-06-23 Thread Steve Farmer
Hi, In Oracle they are all UPPERCASE !! Rgds Steve At 11:15 PM -0400 23/6/02, Gerard Samuel wrote: >Hope someone can confirm this. >I was moving a mysql dump to postgresql, and I had 2 tables with >MiXeD upper/lower case letters, that >got converted to lowercase. I found a discussion that sql

[PHP-DB] sql standard

2002-06-23 Thread Gerard Samuel
Hope someone can confirm this. I was moving a mysql dump to postgresql, and I had 2 tables with MiXeD upper/lower case letters, that got converted to lowercase. I found a discussion that sql column/table/database names should be lowercase. Just trying to keep in line with a standard. Thanks --

[PHP-DB] SQL guru needed: Is this query possible ?

2002-06-18 Thread Max Sullivan
I've been racking my brain for too long trying to figure out how to do this query, I don't think it should be too hard, but I just can't get it right. I've searched and read about every type of join I could find to figure out a way of doing this, but I think I'm either overlooking something simpl

Re: [PHP-DB] sql query problem

2002-06-14 Thread SenthilVelavan
query will helps you. Regards, SenthilVelavan.P - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 15, 2002 2:39 AM Subject: [PHP-DB] sql query problem > I have a database layout similar to this- > > id order title name

RE: [PHP-DB] sql query problem

2002-06-14 Thread Ryan Jameson (USA)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 3:10 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] sql query problem I have a database layout similar to this- id order title namepagecat 0 0 title1 blueap 1 2

[PHP-DB] sql query problem

2002-06-14 Thread chip . wiegand
I have a database layout similar to this- id order title namepagecat 0 0 title1 blueap 1 2 blue1 page1 ap 2 3 blue2 page2 ap 3 1 blue3 page3 ap I would like to get title1 (title col

[PHP-DB] SQL Troubles with JOIN, GROUP BY and MAX???

2002-06-03 Thread Michael Robbins
I've been racking my brain for too long on this one, can someone help me out with a SQL query? I've got 2 tables in a mySQL database, 'users' and 'files' defined as such: USERS --- Id int (autoincrement) Usernamevarchar FILES --

Re: [PHP-DB] sql and week starting ending numbers (dates)

2002-06-01 Thread Bogdan Stancescu
SELECT FROM_DAYS(TO_DAYS(purchaseDate)-DAYOFYEAR(purchaseDate)+WEEK(purchaseDate)*7) will hopefully return the date you need. You'll have to enclose all that in a DATE_FORMAT to get a printable date tho. Last minute note: you might have to subtract 1 from the last term because I guess MySQL st

[PHP-DB] sql and week starting ending numbers (dates)

2002-06-01 Thread Adam Royle
Hello all, I am creating a finance manager in php and mysql for my own accounting purposes (and to broaden my skills in php and sql) and I have a couple of pages where I view statistics on how much I spend, etc, and what patterns are formed from my spending. I have made a couple of pages with

[PHP-DB] Sql from file

2002-05-26 Thread Dave Carrera
Hi All I have a working mysql statement that i would like to load from a file using my php script It first drops table if excists then creates table then loads sample data I have tried many different ways but no success :-( Any help or ideas would be most appreciated I have a

[PHP-DB] sql statement via var

2002-05-26 Thread Dave Carrera
Hi All I am trying to load a mysql statement which i have tested and know to work from a var in my script. It is a create table statement. I have a good connection as a table list shows tables. I tried to echo my var but no joy Any ideas? Thanks in Advance Dave C -- PHP Data

RE: [PHP-DB] sql querry problem

2002-05-03 Thread Ryan Jameson (USA)
IL PROTECTED]] Sent: Friday, May 03, 2002 11:48 AM To: andy Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] sql querry problem "Delete from" does not work with multiple tables, AFAIK.. -Szii - Original Message - From: "andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTEC

Re: [PHP-DB] sql querry problem

2002-05-03 Thread szii
"Delete from" does not work with multiple tables, AFAIK.. -Szii - Original Message - From: "andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 03, 2002 2:02 AM Subject: [PHP-DB] sql querry problem > Hi there, > > I do have

RE: [PHP-DB] sql querry problem

2002-05-03 Thread Ryan Jameson (USA)
ginal Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 3:02 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] sql querry problem Hi there, I do have 2 tables. One contains an update for the other one. Before inserting I would like to delete all the entries in the old table con

[PHP-DB] sql querry problem

2002-05-03 Thread andy
Hi there, I do have 2 tables. One contains an update for the other one. Before inserting I would like to delete all the entries in the old table containing the same country_code like one in the new table. I tryed: delete o.* from Cities_update_imported n, test.cities o where n.country_code = o.

Re: [PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-19 Thread Steve Fry
select * from tmp1, tmp2 where tmp1.si=tmp2.si; > > Does this work for you?? > > Gurhan > > -Original Message- > From: Summit [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 18, 2002 9:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] SQL statement - PHP/mySQL - brai

Re: [PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-18 Thread Frank Flynn
Well it's sorta' simple once you get your mind around this - you need two tables but you've only got one. And there's no OR, you need both to be true for a site_id ... The query would be easy if you actually had two tables so we'll search off of the same table twice giving it different names eac

RE: [PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-18 Thread Gurhan Ozen
elect * from tmp1, tmp2 where tmp1.si=tmp2.si; Does this work for you?? Gurhan -Original Message- From: Summit [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 9:22 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL statement - PHP/mySQL - brain fart For some reason I keep thinking

Re: [PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-18 Thread Jason Wong
On Tuesday 19 March 2002 10:22, Summit wrote: > For some reason I keep thinking that this should be simple - but I just > can't seem to figure it out. Help??? Please??? [I've been working on > it for two days now.] > > Overview: What I'm trying to do is query one table by passing it two > diff

[PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-18 Thread Summit
For some reason I keep thinking that this should be simple - but I just can't seem to figure it out. Help??? Please??? [I've been working on it for two days now.] Overview: What I'm trying to do is query one table by passing it two different variables - and return only the results that are CO

[PHP-DB] sql problem

2002-03-17 Thread its me
i want an sql statment that select from table where prefer has the word auction or cash i tried: $sql="select * from products where prefer like '%cash%' "; and it worked biut i tried: $sql="select * from products where prefer like '%cash%' or prefer like '%auction%' "; but didn't work !!!

RE: [PHP-DB] SQL Question

2002-03-13 Thread Gurhan Ozen
you can do it by using distinct function .. Do: SELECT DISTINCT(city) FROM addresses; Gurhan -Original Message- From: Kevin Diffily [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 2:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Question Hello, I have a simple SQL

RE: [PHP-DB] SQL Question

2002-03-13 Thread Rick Emery
SELECT DISTINCT city FROM addresses; -Original Message- From: Kevin Diffily [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 1:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Question Hello, I have a simple SQL Question. I would like to take the column city in database

[PHP-DB] SQL Question

2002-03-13 Thread Kevin Diffily
Hello, I have a simple SQL Question. I would like to take the column city in database addresses and find out which cities are available in it. In other words if the following values are in there: city El Paso Burlington New York New York El Paso Burlington I would like it to return El Paso

RE: [PHP-DB] SQL

2002-02-20 Thread Rick Emery
I tried the HAVING clause. it fails. This requires sub-selects or multiple tables -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:27 AM To: Jonathan Underfoot; Rick Emery; [PHP-DB] Subject: Re: [PHP-DB] SQL Jonathan, The original

Re: [PHP-DB] SQL

2002-02-20 Thread DL Neil
Jonathan, The original query doesn't work because the WHERE clause is evaluated earlier than the GROUP/COUNT(). Try putting num1 and num2 in a HAVING clause. Regards, =dn > ok... authorizations and charges... two tables.. > > Card Number 1 gets authorized 20 times for use (20 rows in the >

Re: [PHP-DB] SQL

2002-02-20 Thread Jonathan Underfoot
Actually, I'm running MS SQL which should allow me to sub-select Usually I work in MySQL -J - Original Message - From: "Frank Flynn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, February 19, 2002 11:59 PM Subje

Re: [PHP-DB] SQL

2002-02-19 Thread Frank Flynn
On 2/19/02 6:16 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > From: "Jonathan Underfoot" <[EMAIL PROTECTED]> > Date: Tue, 19 Feb 2002 16:28:32 -0500 > To: "Rick Emery" <[EMAIL PROTECTED]>, "[PHP-DB]" <[EMAIL PROTECTE

Re: [PHP-DB] SQL

2002-02-19 Thread Jonathan Underfoot
up... (I might be completely off base here..) Thanx, -Jonathan - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Jonathan Underfoot'" <[EMAIL PROTECTED]>; "[PHP-DB]" <[EMAIL PROTECTED]> Sent: Tuesday, Febru

RE: [PHP-DB] SQL

2002-02-19 Thread Rick Emery
: [PHP-DB] Subject: [PHP-DB] SQL Is it possible to do a comparison of values from a count... for example... SELECT table1.name, count(table1.name) as num1, count(table2.name) as num2 FROM table1, table2 WHERE table1.name = table2.name AND num1 = num2 This sort of thing dosent work for me. How

[PHP-DB] SQL

2002-02-19 Thread Jonathan Underfoot
Is it possible to do a comparison of values from a count... for example... SELECT table1.name, count(table1.name) as num1, count(table2.name) as num2 FROM table1, table2 WHERE table1.name = table2.name AND num1 = num2 This sort of thing dosent work for me. How do I reffrence a count later in

[PHP-DB] SQL Server script conversion tool?

2002-02-19 Thread eshipman1
Anyone have a tool that takes a SQL Server generated script and converts it to a mySQL script? -- __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Nets

Re: [PHP-DB] sql query

2002-02-18 Thread CrossWalkCentral
nd also tru echoing the value of that SQL statement (assign it to a var > first) to make sure you are getting the right thing. > > HTH > > /b > > // -Original Message- > // From: CrossWalkCentral [mailto:[EMAIL PROTECTED]] > // Sent: Tuesday, 19 February 2002 9:31

RE: [PHP-DB] sql query

2002-02-18 Thread Beau Lebens
ntral [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 19 February 2002 9:31 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] sql query // // // I am having a minor problem doing a simple sql query. // // Error performing service query : You have an error in your // SQL syntax near '' at l

[PHP-DB] sql query

2002-02-18 Thread CrossWalkCentral
I am having a minor problem doing a simple sql query. Error performing service query : You have an error in your SQL syntax near '' at line 1 Here is a snip of the code: Please let me know what you think. if ($submit): $status="0"; // REQUEST INFO FOR SERVICES $results = mysql_query( "SELECT

Re: [PHP-DB] SQL/PHP problem

2001-12-19 Thread Joshua Hoover
What format is $expDate in? You'll need to make sure it's in the format your database expects for a date type column. Joshua Hoover > I'm trying to delete rows from a database where the date is older then my > $expDate variable, but for some reason, no matter what I try and what > examples I us

[PHP-DB] SQL/PHP problem

2001-12-19 Thread Brian Grayless
I'm trying to delete rows from a database where the date is older then my $expDate variable, but for some reason, no matter what I try and what examples I use for help, I can't get this to work??? I first took the $expDate string and set the var type to "integer". The datatype for the "msgCreated"

RE: [PHP-DB] SQL problem is killing this newbie

2001-12-11 Thread Rick Emery
uot;Star Wars" && movietitle="Star Trek" && movietitle="Planet of the Apes" In practice, you would construct the movies' titles' "AND" clause in you PHP script -Original Message- From: Samios [mailto:[EMAIL PROTECTED]] Sent: Mon

[PHP-DB] SQL problem is killing this newbie

2001-12-11 Thread Samios
I am having a problem designing a query on a mysql 3.23 database. I have 2 tables - "member" and "movie". The "member" table stores the people details, the "movie" table records the movies they have seen (each record is one movie). MEMBER memberid int not null auto_increment primary key, membern

RE: [PHP-DB] SQL query

2001-11-12 Thread Gonzalez, Lorenzo
l.com/doc/A/N/ANSI_diff_Sub-selects.html -Original Message- From: Pierre Sent: Mon 11/12/2001 12:20 AM To: Gonzalez, Lorenzo; [EMAIL PROTECTED] Cc: Subject: Re: [PHP-DB] SQL query Thanks but I th

Re: [PHP-DB] SQL query

2001-11-11 Thread Pierre
Thanks but I think subselect is not possible with MYSQL. Pierre - Original Message - From: Gonzalez, Lorenzo <[EMAIL PROTECTED]> To: Pierre <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, November 12, 2001 1:08 PM Subject: RE: [PHP-DB] SQL query > in other

RE: [PHP-DB] SQL query

2001-11-11 Thread Gonzalez, Lorenzo
om: Pierre Sent: Sun 11/11/2001 10:01 PM To: [EMAIL PROTECTED] Cc: Subject: [PHP-DB] SQL query I have two tables, one call category, the other chapter Category table [id][name] [1][a]

[PHP-DB] SQL query

2001-11-11 Thread Pierre
I have two tables, one call category, the other chapter Category table [id][name] [1][a] [2][b] [3][c] [4][d] Chapter table [id][FK_name] [1][a] [2][a] [3][c] I would like to get the list of names of the Category table that are NOT present in the Chapter table. On this example, I should find

[PHP-DB] Sql with Sybase variables @@

2001-11-01 Thread Richard Hillström (GIS)
Hi, Is the following possible: $conn = sybase_connect("SERVER,"login","passwd"); $sql = "select @@version"; $result = sybase_query($sql,$conn); while($row = sybase_query($result)) { $r = $row[0]; echo "$r"; } I tried but get a strange error message that I dont understand, what wou

[PHP-DB] SQL expert is needed. - MySQL database

2001-09-12 Thread Scott Mebberson
Hi Guys, here goes.. SELECT count(page_searchwords.word_id) as score, page_data.id, filename, title FROM page_data, pagewords, page_searchwords WHERE (page_searchwords.media_type='static' AND pagewords.id = page_searchwords.word_id AND page_data.id = page_searchwords.id AND LCASE(pagewords.wo

Re: [PHP-DB] SQL combine to summations queries?

2001-09-06 Thread Bas Jobsen
> To do what I think you are trying to do you would use something like: > Select sum(table1.fielda),sum(table2.fieldb) from table1 LEFT JOIN table2 ON > table1.id=table2.id; > if table1.fielda has more rows. > If table2.fieldb has more rows use: the amount of rows is the same :) > Select sum(t

Re: [PHP-DB] SQL combine to summations queries?

2001-09-06 Thread Sheridan Saint-Michel
> Hello, > > I don't understand the following, who can help? > > I have got two queries: > SELECT SUM(fielda) FROM table1 > and > SELECT SUM(fieldb) FROM table2 > > I thought this would be the same as: > SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. > But, itn't, why? > > >

Re: [PHP-DB] SQL combine to summations queries?

2001-09-06 Thread Tom Carter
> Hello, > > I don't understand the following, who can help? > > I have got two queries: > SELECT SUM(fielda) FROM table1 > and > SELECT SUM(fieldb) FROM table2 > > I thought this would be the same as: > SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. > But, itn't, why? I

[PHP-DB] SQL combine to summations queries?

2001-09-06 Thread Bas Jobsen
Hello, I don't understand the following, who can help? I have got two queries: SELECT SUM(fielda) FROM table1 and SELECT SUM(fieldb) FROM table2 I thought this would be the same as: SELECT SUM(fielda.table1),SUM(fieldb.table2) FROM table1, table2. But, itn't, why? Tnx, Bas Jobsen -- PHP

RE: [PHP-DB] SQL problem

2001-09-01 Thread Robert Vukovic
tak 31. avgust 2001. 10:04 > To: Robert Vukovic; [EMAIL PROTECTED] > Subject: Re: [PHP-DB] SQL problem > > > Hi, > Are there any error messages? > Just a guess - may be this will work > > Select $tbl_virtual.thumb1,$tbl_descriptions.short_desc FROM >

Re: [PHP-DB] SQL problem

2001-08-31 Thread Dobromir Velev
-Original Message- From: Robert Vukovic <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Friday, August 31, 2001 7:34 AM Subject: RE: [PHP-DB] SQL problem >> Table was created with this >> >> CREATE TABLE `descriptions` ( >> `id_prop

RE: [PHP-DB] SQL problem

2001-08-30 Thread Robert Vukovic
> Table was created with this > > CREATE TABLE `descriptions` ( > `id_property` bigint(20) NOT NULL default '0', > `short_desc` varchar(255) default NULL, > `long_desc` text, > KEY `id_property`(`id_property`), > PRIMARY KEY (`id_property`), > UNIQUE KEY `id_property_2`(`id_property`)

[PHP-DB] SQL problem

2001-08-30 Thread Robert Vukovic
Table was created with this CREATE TABLE `descriptions` ( `id_property` bigint(20) NOT NULL default '0', `short_desc` varchar(255) default NULL, `long_desc` text, KEY `id_property`(`id_property`), PRIMARY KEY (`id_property`), UNIQUE KEY `id_property_2`(`id_property`) ) TYPE=MyISAM COM

[PHP-DB] SQL query (OT)

2001-08-21 Thread Adv. Systems Design
hi: I have 2 tables, lesson and lesson_gle, where lesson holds lesson data and lesson_gle holds repeating data that are how the lesson correlates to various state standards (one lesson can have many correlations)...one particular lesson may have a math correlation as well as a language arts corre

Re: [PHP-DB] SQL Help?

2001-08-16 Thread Doug Semig
Hi Barry-- First, I want to see if I understand what you mean, then I'll take a shot at some SQL to solve the problem. I take it you have two tables, "a" and "b". They may look something like this: Table: a id name --- -- 001 Bob 002 Ted 003 Mary 004 S

[PHP-DB] SQL Help?

2001-08-16 Thread Barry Prentiss
Hi, Here's another SQL query problem: How do I construct a query that returns 1 if a value is present and zero if it is not, for a list of values returned in another query? i.e. select a.id, a.name, c.selected from table-with-id-and-name a, (select 1 as selected from another-table b if a.id

Re: [PHP-DB] SQL Error

2001-08-02 Thread Martin Lefebvre
Have you tried with NULL instead of '' the ContactID? On Thu, 2 Aug 2001, Steve Fitzgerald wrote: > I keep getting the following SQL error: > > You have an error in your SQL syntax near ')' at line 14 > > Line 14 is: '$FirstName', so the error must correspond to a different part > of the code.

[PHP-DB] SQL Error

2001-08-02 Thread Steve Fitzgerald
I keep getting the following SQL error: You have an error in your SQL syntax near ')' at line 14 Line 14 is: '$FirstName', so the error must correspond to a different part of the code. Any ideas? $add_contact_sql = "INSERT INTO $table_name (ContactID, FirstName, LastName, Title, WorkPhone, Hom

Re: [PHP-DB] SQL error:

2001-07-06 Thread Andrei Skorokhod
Which user are you connected as? Who owns the table? unless you connected as the user who owns the table or table is owned by dbo you have to specify username.TBL_DEPT (where username is the name of the user who owns the table) At 16:47 06.07.2001 +0800, you wrote: >[EMAIL PROTECTED] -- PHP

[PHP-DB] SQL error:

2001-07-06 Thread Jennifer Arcino Demeterio
hello!!! i'm getting this error. what does this mean? hope someone can help. i'm using sql7 in NT4 server Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'TBL_DEPT'., SQL state S0002 in SQLExecDirect in F:\Web

Re: [PHP-DB] sql problem

2001-06-26 Thread Doug Semig
A quick glance suggests to me that it is a nonstandard proprietary extension to SQL that provides a way to set a kind of a variable and use it in a subsequent nonstandard proprietary SQL-looking statement that is awfully procedural. You'll probably want to either consult the documentation for the

RE: [PHP-DB] sql problem

2001-06-26 Thread Mats Remman
nd the database can be held to a minimum. Mats Remman PHP Developer, MySQL DBA Coretrek, Norway +47 51978591 / +47 91623566 > -Original Message- > From: Fai [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 26, 2001 5:55 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] sql p

Re: [PHP-DB] sql problem

2001-06-26 Thread Hugh Bothwell
""Fai"" <[EMAIL PROTECTED]> wrote in message 9h90l2$1op$[EMAIL PROTECTED]">news:9h90l2$1op$[EMAIL PROTECTED]... > SELECT @A:=SUM(salary) FROM table1 WHERE type=1; > UPDATE table2 SET summmary=@A WHERE type=1; > > What does @A: mean? > > Thank you very much! They're writing the sum to an SQL vari

[PHP-DB] sql problem

2001-06-26 Thread Fai
SELECT @A:=SUM(salary) FROM table1 WHERE type=1; UPDATE table2 SET summmary=@A WHERE type=1; What does @A: mean? Thank you very much! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the

Re: [PHP-DB] Sql result loop problem !

2001-05-18 Thread Jason Stechschulte
On Fri, May 18, 2001 at 04:32:51PM +0200, Keith Whyman wrote: > while ($p = mysql_fetch_array($result1)) { > > $msg .= $p["s_bereich_name"]; > $msg .= $p["s_news_text"]; > $msg .= $p["s_users_real_name"]; I'm not sure if this is what you want, but something like this maybe?? \n"; $oldBere

[PHP-DB] Sql result loop problem !

2001-05-18 Thread Keith Whyman
I know someone can help ! Following sql SELECT DISTINCT s_news_text,s_bereich_name,s_users_real_name,s_bereich_id FROM s_news,s_users,s_bereich WHERE (s_news_user_id = s_users_user_id) AND (s_news_bereich_id = s_bereich_id) AND (s_news_sent ='0') ORDER BY s_bereich_name while ($p = mysql_fetch_

[PHP-DB] SQL Server S1000 Weird Errors

2001-05-08 Thread John Nunez
BACKGROUND: I was recently given a task to add a table to a MS SQL Server and a few PHP pages to insert, edit, delete and display records from this table. The site is currently running off an Linux Server with PHP 4.03 and a Windows NT box running MS SQL Server 7.0. The SQL Server is unreachable

<    1   2   3   4   >