[PHP-DB] SQL statement

2005-01-06 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody, I'm building a small application and I have trouble passing a POST variable form one page to another inside the SQL statement. The query displayed below works great without the .$_POST['CompanyName']. $query_company_listing = SELECT CompanyID, CompanyName, CompanyOrDepartment,

RE: [PHP-DB] SQL statement

2005-01-06 Thread Jason Walker
@lists.php.net Subject: [PHP-DB] SQL statement Hello everybody, I'm building a small application and I have trouble passing a POST variable form one page to another inside the SQL statement. The query displayed below works great without the .$_POST['CompanyName']. $query_company_listing = SELECT

Re: [PHP-DB] SQL Insert problem (SOLVED), Thanks!

2004-08-08 Thread Vincent Jordan
: [SPAM] Re: [PHP-DB] SQL Insert problem From: Vincent Jordan [EMAIL PROTECTED] $sql = INSERT INTO rmarequest (firstname, lastname, address, address2, city, state, zip, phone, email, serial, product, reason, rmanumber)VALUES ('$firstname', '$lastname', '$address', '$city

RE: [PHP-DB] SQL Insert problem

2004-08-05 Thread Hutchins, Richard
To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Insert problem Im having a problem inserting data. Ive looked over this again and again and can not find what ive missed. Everything else works besides the db insert. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http

[PHP-DB] SQL Insert problem

2004-08-05 Thread Vincent Jordan
Im having a problem inserting data. Ive looked over this again and again and can not find what ive missed. Everything else works besides the db insert. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; ?php ini_set

RE: [PHP-DB] SQL Insert problem

2004-08-05 Thread Vincent Jordan
, August 05, 2004 10:26 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] SQL Insert problem You're missing address2 in your list of values. This means that you have an unmatching number of column names and values in your query and that'll make the query bomb. Rich -Original Message

Re: [PHP-DB] SQL Insert problem

2004-08-05 Thread Torsten Roehr
John W. Holmes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From: Vincent Jordan [EMAIL PROTECTED] Im having a problem inserting data. Ive looked over this again and again and can not find what ive missed. Everything else works besides the db insert. It would have helped if

Re: [PHP-DB] SQL Insert problem

2004-08-05 Thread John W. Holmes
From: Vincent Jordan [EMAIL PROTECTED] $sql = INSERT INTO rmarequest (firstname, lastname, address, address2, city, state, zip, phone, email, serial, product, reason, rmanumber)VALUES ('$firstname', '$lastname', '$address', '$city', '$state', '$zip', '$phone', '$email',

RE: [PHP-DB] SQL Insert problem

2004-08-05 Thread Hutchins, Richard
: Thursday, August 05, 2004 11:06 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] SQL Insert problem I have inserted '$address2', correctly in the row however it is still not putting the data in the table. I am not getting an error but I do believe I have correct syntax set to display

RE: [PHP-DB] SQL Insert problem

2004-08-05 Thread Miles Thompson
: Thursday, August 05, 2004 10:25 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Insert problem Im having a problem inserting data. Ive looked over this again and again and can not find what ive missed. Everything else works besides the db insert. !DOCTYPE html PUBLIC -//W3C//DTD

[PHP-DB] SQL injection prepared statements

2004-06-25 Thread Gerard Samuel
Just looking for opinions on sql injection while using prepared statements. I've read at the oci8 extention that content should not be escaped --- Do not use magic_quotes_gpc or addslashes() and oci_bind_by_name() simultaneously as no quoting is needed and any magically applied quotes will be

[PHP-DB] SQL help

2004-06-23 Thread Gabe
I'm using PHP with ADOdb ( and an MS Access 2000 db ) to write a simple SQL statement but was running into some case sensitivity issues. Here's my SQL currently: SELECT autoQuesID,fldQuesTitle,fldBody FROM tblFAQ_Question WHERE fldBody LIKE '%$strSearchFor%'; All I'm trying to do is have the

Re: [PHP-DB] SQL help

2004-06-23 Thread Gabe
Specialist Carroll College CCIT (406)447-4310 -Original Message- From: Gabe [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 8:59 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL help I'm using PHP with ADOdb ( and an MS Access 2000 db ) to write a simple SQL statement but was running

[PHP-DB] SQL Statement

2004-05-18 Thread Thompson, Jimi
For some background, I've been tasked with building a marketing tracking application by the PHB's who think that being able to write SQL means you can code. I know how to get data into a database and I can do thing with it once it's in there, but this is one of my first attempts at extracting

Re: [PHP-DB] SQL Statement

2004-05-18 Thread Cal Evans
Jimi, PHP does not return an error because it knows nothing about valid sql. It's just knows if it's a valid PHP statement. (which it is because you've got the 's in the right place and a ; at the end. ) :) It's up to MySQL to return an error. As to your statement. 1: It's easier and valid in

Re: [PHP-DB] SQL Statement

2004-05-18 Thread John W. Holmes
Thompson, Jimi wrote: So then I try do this ?php if ($fk_phone != NULL) { $sqlwrk = SELECT `pk_phone_reports`, SUM(`calls`) AS `total_calls`, `date`, `calls` , `fk_ph_num` FROM `phone_reports`; $sqlwrk .= WHERE `pk_phone_number` = . $fk_phone; $rswrk =

Re: [PHP-DB] SQL question!

2004-05-03 Thread Larry E . Ullman
I have these tables. Users ( id,name,etc ) Coments : ( id , comment ) How do I do this kind of query: I thought in one thing like this but I cant figure it out. Example: Select * from users order by id desc in (select count (id) from comments) Expected result: List of users: * User1 See

[PHP-DB] SQL question!

2004-05-03 Thread Bruno Braga
Hey. I have these tables. Users ( id,name,etc ) Coments : ( id , comment ) How do I do this kind of query: I thought in one thing like this but I cant figure it out. Example: Select * from users order by id desc in (select count (id) from comments) Expected result:

[PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread Vern
I found this code below that allows me to retreive the queries served on my server for each day but can't figure out how to actually display the information using echo. Can some one give me an example using the following SQL? SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id) FROM email WHERE

Re: [PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread John W. Holmes
Vern wrote: I found this code below that allows me to retreive the queries served on my server for each day but can't figure out how to actually display the information using echo. Can some one give me an example using the following SQL? SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id) FROM

Re: [PHP-DB] SQL for Showing the number of queries served on each day.

2004-04-30 Thread Vern
That did it thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] SQL Server Query Failed

2004-03-17 Thread david
Hello there! I have just about driven myself crazy with an odd intermittent problem. I have an intranet site, a good size one at that, on a Windows 2000 Server, running Apache, connecting to another Windows 2000 Server running SQL Server 2000. It all works just peachy, and life is good. But

Re: [PHP-DB] SQL Server Query Failed

2004-03-17 Thread Bruno Ferreira
david wrote: Hello there! I have just about driven myself crazy with an odd intermittent problem. [snip] I'd first start by turning on all logging I could in the SQL server so that I could see what's happening straight from the horse's mouth... Bruno Ferreira --- [This E-mail scanned

Re: [PHP-DB] SQL Server Query Failed

2004-03-17 Thread Robert Twitty
What type of field is PhaseFK? -- bob On Wed, 17 Mar 2004, david wrote: Hello there! I have just about driven myself crazy with an odd intermittent problem. I have an intranet site, a good size one at that, on a Windows 2000 Server, running Apache, connecting to another Windows 2000

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-27 Thread Ricardo Lopes
. - Original Message - From: Doug Thompson [EMAIL PROTECTED] To: Robin 'Sparky' Kopetzky [EMAIL PROTECTED] Cc: Erwin Kerk [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:04 AM Subject: Re: [PHP-DB] SQL File Import problem (Was: HELP!!!) On Fri, 27 Feb 2004 01:16:20

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Doug Thompson
On Fri, 27 Feb 2004 01:16:20 +0100, Erwin Kerk wrote: Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone

RE: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Robin 'Sparky' Kopetzky
Thank you to all who helped. I was able using UltraEdit to chop up the sql file and created all of the individual INSERT statements. Now, I'm up and running again. Slow but it worked! Thanks again! Robin Kopetzky -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Erwin Kerk
Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this

RE: [PHP-DB] sql, problem with join and presentation

2004-02-17 Thread Angelo Zanetti
i think the newer versions of MYSQL allow for subselects and I think that is what you want. see www.mysql.net -Original Message- From: mayo [mailto:[EMAIL PROTECTED] Sent: Sunday, February 15, 2004 11:56 PM To: php-db Subject: [PHP-DB] sql, problem with join and presentation Currently

Re: [PHP-DB] sql, problem with join and presentation

2004-02-17 Thread Frank Flynn
] Sent: Sunday, February 15, 2004 11:56 PM To: php-db Subject: [PHP-DB] sql, problem with join and presentation Currently I display a list of classes. Simplified SQL and display below: SELECT * FROM classes WHERE classCategory='$Category' AND classDeleted=0 ORDER BY $order $reorder

[PHP-DB] sql, grouping problem

2004-02-16 Thread mayo
I'm trying to group the output of a query. I can do it with cold fusion but cannot figure it out using php. Currently I display a list of classes: +--+--++ | CLASS TITLE | LOCATION | CLASS CODE | +--+--++ |

Re: [PHP-DB] sql, grouping problem

2004-02-16 Thread John W. Holmes
mayo wrote: cold fusion allows you to group output (see below) Select c.classId, c.classTexts, c.classDescription, cc.classCodeSection, cc.classDate, cc.classTime, cc.classLocation, cc.classInstructor FROM CLASSES c, CLASSCODES cc WHERE c.classId = cc.classId AND ... ORDER BY

[PHP-DB] sql, problem with join and presentation

2004-02-15 Thread mayo
Currently I display a list of classes. Simplified SQL and display below: SELECT * FROM classes WHERE classCategory='$Category' AND classDeleted=0 ORDER BY $order $reorder The presentation is: +--+--++ | CLASS TITLE | LOCATION | CLASS CODE

[PHP-DB] sql query, editing?

2004-01-15 Thread Louie Miranda
I have this code below, it fetches data on a mysql database. I was hoping you could give me a code hint on where could, my goal is to display this data on a browser which i did already and be able to edit it via a form. edit? - table1=value - table2=value I dont know where to start. please help

RE: [PHP-DB] sql query, editing?

2004-01-15 Thread Humberto Silva
Silva World Editing Portugal -Original Message- From: Louie Miranda [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 15 de Janeiro de 2004 8:00 To: [EMAIL PROTECTED] Subject: [PHP-DB] sql query, editing? I have this code below, it fetches data on a mysql database. I was hoping you could

[PHP-DB] SQL query...

2004-01-15 Thread Tristan . Pretty
SELECT DISTINCT(file_name), Count(file_name) FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by ??? desc In the above sql statement, I'm trying to achieve: 1. select all file names, between two dates. 2. list them, and order by the highest number

RE: [PHP-DB] SQL query...

2004-01-15 Thread brett king
SELECT DISTINCT(file_name), Count(file_name) FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by ??? desc In the above sql statement, I'm trying to achieve: 1. select all file names, between two dates. 2. list them, and order by the highest number of

RE: [PHP-DB] SQL query...

2004-01-15 Thread Tristan . Pretty
Ah... you can name the count().. live and learn, cheers dude... brett king [EMAIL PROTECTED] 15/01/2004 11:17 Please respond to [EMAIL PROTECTED] To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject RE: [PHP-DB] SQL query... SELECT DISTINCT(file_name), Count(file_name) FROM $table_name

Re: [PHP-DB] SQL query...

2004-01-15 Thread Nitin Mehta
: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 15, 2004 4:31 PM Subject: [PHP-DB] SQL query... SELECT DISTINCT(file_name), Count(file_name) FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by ??? desc In the above sql statement

Re: [PHP-DB] SQL query...

2004-01-15 Thread Muhammed Mamedov
: Thursday, January 15, 2004 1:01 PM Subject: [PHP-DB] SQL query... SELECT DISTINCT(file_name), Count(file_name) FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by ??? desc In the above sql statement, I'm trying to achieve: 1. select all file names

Re: [PHP-DB] SQL query...

2004-01-15 Thread CPT John W. Holmes
From: Muhammed Mamedov [EMAIL PROTECTED] Try this SELECT DISTINCT(file_name), Count(file_name) AS cnt FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by cnt; desc If you're GROUPing by file_name then you don't need DISTINCT(file_name)... it's

[PHP-DB] SQL WHERE datetime NOW

2004-01-03 Thread John Dillon
Thanks for that. In fact, it was something else wrong and it does work. However, I do have another problem on this. The query is: ...WHERE TO_DAYS(NOW())+1TO_DAYS(MyTable.MyField) ORDER BY MyTable.MyField DESC LIMIT 30; however, the LIMIT seems to apply before the ORDER BY clause. How can

RE: [PHP-DB] sql errors?

2003-12-16 Thread N . A . Morgan
is register_globals set to off in php.ini? this may be the issue if it is set to on. -Original Message- From: Jas [mailto:[EMAIL PROTECTED] Sent: 15 December 2003 22:50 To: [EMAIL PROTECTED] Subject: [PHP-DB] sql errors? I have checked and rechecked my code on these php to mysql

[PHP-DB] sql errors?

2003-12-15 Thread Jas
I have checked and rechecked my code on these php to mysql statements and for some reason I either get no data (through php, where through a command line I get all the data I need) or errors on the update function. Could someone tell me what I am doing wrong? $sql = mysql_query(SELECT

Re: [PHP-DB] sql errors?

2003-12-15 Thread Tobey Wheelock
On Mon, Dec 15, 2003 at 03:49:31PM -0700, Jas wrote: $sql = mysql_query(SELECT hostname FROM $table WHERE vlan = $_POST[dhcp_hosts],$db)or die(mysql_error()); Maybe like this? $sql = mysql_query(SELECT hostname FROM $table WHERE vlan = '. $_POST[dhcp_hosts].',$db)or die(mysql_error()); --

[PHP-DB] SQL question

2003-12-11 Thread Constantin Brinzoi
I know it is possible to search a database like this: SELECT * FROM x_table WHERE name=%part_of_name% but I don't know for sure the correct command. Could you tell me the right syntax? TIA Aurel. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
It should be as follows: SELECT * FROM x_table WHERE name Like = %part_of_name% Hope this helps, M.Mamedov - Original Message - From: Constantin Brinzoi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 11, 2003 1:51 PM Subject: [PHP-DB] SQL question I know

RE: [PHP-DB] SQL question

2003-12-11 Thread brettking
try SELECT * FROM x_table WHERE name LIKE %part_of_name% -Original Message- From: Constantin Brinzoi [mailto:[EMAIL PROTECTED] Sent: 11 December 2003 11:52 To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL question I know it is possible to search a database like this: SELECT

Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
M.Mamedov - Original Message - From: Muhammed Mamedov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 11, 2003 2:00 PM Subject: Re: [PHP-DB] SQL question It should be as follows: SELECT * FROM x_table WHERE name Like = %part_of_name% Hope this helps, M.Mamedov

[PHP-DB] sql query

2003-11-25 Thread pete M
why does this select date(date_file_created) from files create the error error near near '(date_file_created) from files' at line 1 trying to extract the date part of the date_tile filed tia pete -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] SQL SERVER 2000 with PHP and FOR XML clause

2003-11-05 Thread Orlik, Edward \[BRAM:1281:EXCH\]
Hi, Has anybody had any luck using the ODBC libraries in PHP to connect to a SQL Server 2000 database and passing in a SELECT with a FOR XML clause. I keep getting Warning: odbc_execute(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]The FOR XML clause is not allowed in a CURSOR

[PHP-DB] SQL COUNT vs mysql_num_rows

2003-11-05 Thread [EMAIL PROTECTED]
maybe mysql cannot COUNT the result from more than 1 table, hence the mysql_num_rows function - but isn't it good programming practice to get the SQL to do as much work up front? - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard

Re: [PHP-DB] SQL COUNT vs mysql_num_rows

2003-11-05 Thread Boyan Nedkov
if tables are joined correctly it shouldn't be any problem to get count of a column, and yes - delegating that task to the database should be more efficient concerning the execution time boyan -- [EMAIL PROTECTED] wrote: maybe mysql cannot COUNT the result from more than 1 table, hence the

[PHP-DB] SQL Server Connect Issues

2003-11-03 Thread Thomas W. Gallup
First, I will admit that I am new to PHP. I'm installing PHP on our Windows 2K / IIS server for some users who want to use it. We also host SQL Server 7 for websites. I'm getting the following error on the server, and on the client's webpages: PHP Warning: Unknown(): Invalid library (maybe not

Re: [PHP-DB] SQL Server Connect Issues

2003-11-03 Thread Alain Barthlemy
It may of course not be a solution but personnally I installed Apache on port 8100 with PHP on W2000 and it works fine with MySQL and/or MsSQL. Just in case ... AB Le lundi 03 novembre 2003, 15:31:08 ou environ Thomas W. Gallup [EMAIL PROTECTED] a écrit: First, I will admit that I am new to

Re: [PHP-DB] SQL Server Connect Issues

2003-11-03 Thread Frank M. Kromann
Hi Tom, What you need to get the instalation to work is these: php.exe (CGI version) php4ts.dll php_mssql.dll php.ini in the same directory. I know you can make many different combinations of files and directories but this minimum will work. You can aslo also add php4isapi.dll if you want to

[PHP-DB] SQL type queries on arrays?

2003-10-20 Thread Nicholls, David
Title: SQL type queries on arrays? Hello, I am developing an intranet application which parses a CSV file into a 2-D array, then searches for all unique values (PHP function) of a field and the most recent record in each case (foreach loops). I have a working routine that takes about 15

[PHP-DB] SQL File Insert???

2003-10-12 Thread John Ryan
Ive a file on my server with SQL instructions to create a table and insert stuff. How do I get this to be run on the database? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] SQL File Insert???

2003-10-12 Thread Martin Marques
El Dom 12 Oct 2003 17:36, John Ryan escribió: Ive a file on my server with SQL instructions to create a table and insert stuff. How do I get this to be run on the database? Once againg, somebody that doesn't specify which database server he is using Pleas, be more specific! -- Porqué

[PHP-DB] SQL Server 2000 problem (column_source in mssql_fetch_field function)

2003-09-26 Thread Elson Moura
Hello everybody, I need help in order to get the table name of a field in SQL Server 2000. In order to get the table name of a specific column in a query, I tried to use mssql_fetch_field function. But column_source is, in fact, the column name, not the table name how it was supposed to be. In a

[PHP-DB] sql optimizing assistance

2003-09-19 Thread jeffrey_n_Dyke
I have two tables and am running a simple join between them to get questions and their repsective response averages from a survey. The question table has 49 rows and the Response table has 126,732. I'd like to cut down on the time its taking to run this specific query...as i'll be running many

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I have two tables and am running a simple join between them to get questions and their repsective response averages from a survey. The question table has 49 rows and the Response table has 126,732. I'd like to cut down on the time its taking to run this specific

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread jeffrey_n_Dyke
Subject: Re: [PHP-DB] sql optimizing assistance 09/19/2003 03:59

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread Micah Stevens
run this query: EXPLAIN SELECT Question.Text_Long, AVG( Response ) FROM `Response` INNER JOIN Question ON Question.Question_Key = Response.Question_Key WHERE Question.Question_Key LIKE '2003%' GROUP BY Response.Question_Key ORDER BY Question.Question_Key ASC and post the results. This will

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread Jeff Shapiro
it. For more info: http://www.mysql.com/doc/en/MySQL_indexes.html On Fri, 19 Sep 2003 16:01:34 -0400, [EMAIL PROTECTED] spoke thusly about Re: [PHP-DB] sql optimizing assistance: i new i forgot to include something. here this is the ouput. it looks like its using none of my indexes

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread jeffrey_n_Dyke
] Subject: Re: [PHP-DB] sql optimizing assistance 09/19/2003 05:42

[PHP-DB] SQL Join problem (Firebird)

2003-09-03 Thread Evan Morris
Hi all Say you have two tables, TABLE1 and TABLE2. Each table contains (amongst others) a field called SOMEVALUE Now, in TABLE1 SOMEVALUE contains string1, but in TABLE2 SOMEVALUE contains string2. Now you join these tables (on SOMEOTHERVALUE) and you loop through the results set: while ($row

Re: [PHP-DB] SQL Join problem (Firebird)

2003-09-03 Thread Sean Burlington
Evan Morris wrote: Hi all Say you have two tables, TABLE1 and TABLE2. Each table contains (amongst others) a field called SOMEVALUE Now, in TABLE1 SOMEVALUE contains string1, but in TABLE2 SOMEVALUE contains string2. Now you join these tables (on SOMEOTHERVALUE) and you loop through the results

Re: [PHP-DB] sql or php?

2003-08-14 Thread otherguy
On Tuesday, August 5, 2003, at 05:56 PM, Merlin wrote: Hi there, I am wondering if this could be done with mysql and without php, just with sql. I do have a table with text and another one with pictures. Now I would like to print out all titles and mark those tests containing a picture with a

[PHP-DB] sql or php?

2003-08-07 Thread Merlin
Hi there, I am wondering if this could be done with mysql and without php, just with sql. I do have a table with text and another one with pictures. Now I would like to print out all titles and mark those tests containing a picture with a camera. I tryed some LEFT JOIN stuff, and grouped it by

Re: [PHP-DB] sql or php?

2003-08-07 Thread Joshua D. Drake
I could probably help you easily but table structure would be helpful. On Wed, 6 Aug 2003, Merlin wrote: Hi there, I am wondering if this could be done with mysql and without php, just with sql. I do have a table with text and another one with pictures. Now I would like to print out all

[PHP-DB] sql to find one year in datetime MySQL column

2003-07-16 Thread bill
How can I find all the records for a single year from a db that has a datetime column (in MySQL)? This seems to work: SELECT * from mytable WHERE tstamp '2003-01-01 00:00:00' AND tstamp '2002-01-01 00:00:00' But this doesn't: SELECT * from mytable WHERE tstamp LIKE '2002%' Is there a simpler

[PHP-DB] SQL Server connection error.

2003-06-07 Thread Russell Roberts-Spears
Hi, I am new to PHP DB code and am currently struggling with the connection to SQL Server 2000. I am using ODBC and have created a System DSN with integrated NT security specifiying which DB etc. I have written the following code and posted it in the htdocs folder for Apache. (We are all

[PHP-DB] SQL server procedore how to

2003-02-23 Thread Noam Giladi
i have a aprocedure simple_proc i try to call her with mssql_query like this: $q=exec simple_proc; $ret = mssql_query($q,$__[db connection]); the result i get is:

Re: [PHP-DB] SQL server procedore how to

2003-02-23 Thread Mark
You need to ue mssql_fetch_*() to actually put the data into an array. --- Noam Giladi [EMAIL PROTECTED] wrote: i have a aprocedure simple_proc i try to call her with mssql_query like this: $q=exec simple_proc; $ret =

RE: [PHP-DB] SQL: Limit 1 usage?

2003-01-30 Thread Nick Hajek
Your missing a ' before the area code. -Original Message- From: jason wesley upton [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 2:43 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL: Limit 1 usage? Currently I have a script that contains this piece of code: $sql

Re: [PHP-DB] SQL: Limit 1 usage?

2003-01-30 Thread 1LT John W. Holmes
$sql = SELECT * FROM accessnums WHERE areacode=$_POST[areacode]' and city='$_POST[cityselected]' ORDER BY network LIMIT 1; It can't execute the query. Any suggestions? Unless it's a typo, you're missing a single quote around $_POST[areacode]... ---John Holmes... -- PHP Database Mailing

Re: [PHP-DB] SQL: Limit 1 usage?

2003-01-30 Thread jason wesley upton
- Original Message - From: jason wesley upton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 30, 2003 9:42 PM Subject: [PHP-DB] SQL: Limit 1 usage? Currently I have a script that contains this piece of code: $sql = SELECT MIN(network

RE: [PHP-DB] SQL: Limit 1 usage?

2003-01-30 Thread John W. Holmes
, January 30, 2003 5:12 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SQL: Limit 1 usage? Hmm, I trried your syntax and same problem. I tried it exactly like this: (though i'd like to stress that it worked with the code labeled ORIGINAL below) ?php

Re: [PHP-DB] sql syntax error

2003-01-29 Thread 1LT John W. Holmes
- Original Message - From: Addison Ellis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 10:46 PM Subject: [PHP-DB] sql syntax error hello, i can not pinpoint this. your time and help is very much appreciated. best, addison Error: id=, HTTP_POST_VARS

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

2003-01-28 Thread Boaz Yahav
Is it possible that the tables at school are not indexed? berber -Original Message- From: Paolo Bonavoglia [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 7:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SQL very fast here very slow there At 16:43 24/01/2003 24/01/2003

[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

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

[PHP-DB] sql query links

2003-01-24 Thread david
i'm starting out in this whole thing, and i'm trying to program a zine that uses a sql database for content and calls the content into a template. what i am unclear on how to do is set up the links so that I can get the info from the database. anyone willing to help me out? -- PHP Database

[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 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

[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

RE: [PHP-DB] sql select

2002-11-12 Thread Edward Peloke
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,works_orders,parts WHERE

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

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 won't

Re: [PHP-DB] SQL update help

2002-09-21 Thread Ignatius Reilly
, 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'; Be sure you use double-quotes to build the string (so that all variables get interpolated) and single-quotes within

[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 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

Re: [PHP-DB] SQL file,

2002-09-21 Thread Brad Bonkoski
[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: CREATE DATABASE some_name ( ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, NAME varchar(30), etc

Re: [PHP-DB] SQL file,

2002-09-21 Thread John Coder
- From: Brad Bonkoski [EMAIL 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: CREATE DATABASE some_name ( ID int

[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 update help

2002-09-20 Thread Jeffrey_N_Dyke
: Subject: [PHP-DB] SQL update help 09/20/2002 03:13 AM

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

RE: [PHP-DB] SQL newbie

2002-09-08 Thread Boaz Yahav
- 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,Subject,Sender,Email,Message

[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 great

<    1   2   3   >