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,
@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
: [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
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
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
, 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
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
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',
: 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
: 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
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
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
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
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
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
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 =
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
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:
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
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
That did it thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
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
.
- 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
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
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:
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
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
]
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
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 |
+--+--++
|
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
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
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
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
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
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
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
: [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
: 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
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
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
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
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
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());
--
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:
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
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
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
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:
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
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
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
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
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
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
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
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
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é
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
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
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
Subject: Re: [PHP-DB] sql optimizing
assistance
09/19/2003 03:59
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
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
]
Subject: Re: [PHP-DB] sql optimizing
assistance
09/19/2003 05:42
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
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
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
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
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
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
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
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:
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 =
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
$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
- 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
, 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
- 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
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
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
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
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
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
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
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
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
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
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
, 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
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
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
[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
-
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
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
--
:
Subject: [PHP-DB] SQL update help
09/20/2002
03:13 AM
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
-
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
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
101 - 200 of 295 matches
Mail list logo