[PHP-DB] Nested SQL query problem...

2002-05-28 Thread Srinivasan Ramakrishnan
Hi, I have a table that contains the prices of software products at different quantity slab rates. I'm trying to get the Slab rate for a given number of licenses for a given product_id. For example, what is the cost of 500 licenses of Product_ID 143 ? The slabs do not continue for an infinite

[PHP-DB] Re: Can you SUM(IF) from two different tables at the same time?

2002-05-28 Thread Hugh Bothwell
"Richard Davey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > In the 5th line I changed "thread.id" to "thread.threadid" so the name was > correct but the same error occurs. Ok, I was guessing at your field names... > to give a perfectly satisfactory res

[PHP-DB] Re: Can you SUM(IF) from two different tables at the same time?

2002-05-28 Thread Richard Davey
"Hugh Bothwell" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Instead, you want a query which returns a record > with "thread count" and "message count" for each > group. > > SELECT > COUNT(DISTINCT threadid) AS threads, > COUNT(*) AS messages > FROM >

[PHP-DB] REGEX help.

2002-05-28 Thread Kevin Stone
All I need to do is return anything matching the following pattern from a specific column in a table. This is how I'd write it in PHP if I were pulling the data from string. The string in this example is a direct copy of one of the column fields.. What would be the SQL equivilant? I hate to

[PHP-DB] Not associated with a trusted SQL Server error

2002-05-28 Thread Brian
Server : sql 2000 sp2 in SQL authentication mode If I run c:\php\php.exe test1.php it produces the correct html output displaying the rows. Which means SQL is functioning with the username/pw configuration in the php code. But if called THRU Internet Service manager, the exact same test1.php file

Re[2]: [PHP-DB] creating errors

2002-05-28 Thread Julie Meloni
EG> try just: EG> $sql = "INSERT INTO $table_name (f_name,l_name,email_addy,un,pw) VALUES EG> ('$f_name','$l_name','$email_addy','$un', 'PASSWORD('$pw')'"; Make that ... password('$pw'), without the single quotes around the password() function. Otherwise, it will print it literally. - Juli

Re: [PHP-DB] creating errors

2002-05-28 Thread Ed Gorski
try just: $sql = "INSERT INTO $table_name (f_name,l_name,email_addy,un,pw) VALUES ('$f_name','$l_name','$email_addy','$un', 'PASSWORD('$pw')'"; ed At 09:55 AM 5/28/2002 -0600, Jas wrote: >I am trying to add an insert into a table and set one of the fields to a >password hash, however I am recie

RE: [PHP-DB] creating errors

2002-05-28 Thread Ryan Jameson (USA)
pw= is not valid SQL syntax. :-) <>< Ryan -Original Message- From: Jas [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:55 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] creating errors I am trying to add an insert into a table and set one of the fields to a password hash, however I

[PHP-DB] creating errors

2002-05-28 Thread Jas
I am trying to add an insert into a table and set one of the fields to a password hash, however I am recieving errors: $sql = "INSERT INTO $table_name (f_name,l_name,email_addy,un,pw) VALUES ('$f_name','$l_name','$email_addy','$un', 'pw=PASSWORD('$pw')'"; Is there any reason this would not work?

[PHP-DB] Re: Simulating a FORM POST thing (HELP!)

2002-05-28 Thread Manuel Lemos
Hello, On 05/26/2002 04:05 PM, Georgie Casey wrote: > Rite, when you see a web form, you know you can simulate the submit by > filling in the values in the address field, just like a GET method, and it > usually works the exact same. But how do you do it when one of the fields in > the form is a

RE: [PHP-DB] INSERT problem - please help!

2002-05-28 Thread Jen Swofford
Thanks everyone - it turns out that variables can not begin with a number, as someone else on this list learned today as well. Doh! :) Jen Swofford [EMAIL PROTECTED] > On Tuesday 28 May 2002 06:00, Jen Swofford wrote: > > I have a problem. I am working on two separate sites on two separate >

[PHP-DB] Re: Can you SUM(IF) from two different tables at the same time?

2002-05-28 Thread Hugh Bothwell
"Richard Davey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > 1. SELECT SUM(IF(boardid='2',1,0)) AS b2, SUM(IF(boardid='1',1,0)) AS b1, > COUNT(*) AS total FROM thread > > 2. SELECT SUM(IF(boardid='2',1,0)) AS b2, SUM(IF(boardid='1',1,0)) AS b1, > COUNT(*) AS

[PHP-DB] FW: hello ... best schema to a forum

2002-05-28 Thread José Moreira
im trying to figure out the best mySQL schema to create a forum on my website ... to result in a tree-view style presentation what i have right now is a 3 table schema : categories > sub-categories > lines ... wich would result in a code parsing to emulate the tree the other way is a nodes->l

Re: [PHP-DB] Error? new set of eyes...

2002-05-28 Thread Jason Wong
On Tuesday 28 May 2002 21:15, Jas wrote: > Hello all, > I have an error and I will be darned if I know why. Here is the code: > require '/path/to/database/connection/class/db.php'; > $table = "portfolio"; > $portfolio = @mysql_query("SELECT * FROM $table",$dbh); > while ($sections = mysql_fe

Re: [PHP-DB] Error? new set of eyes...

2002-05-28 Thread Ed Gorski
Why don't you try this instead: while(list($id, $2d, $3d, $web, $prog, $tut, $proj)=mysql_fetch_array($portfolio)) { do whatever.. } the list construct only works with numerical arrays and it might not like the $section array (doesn't it get stored as number indicies AND column names?

[PHP-DB] Error? new set of eyes...

2002-05-28 Thread Jas
Hello all, I have an error and I will be darned if I know why. Here is the code: Then I just echo the contents of the database array like so. // this is line 69 And this is the error I am recieving: Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /localhost/portfolio.php on lin

Re: [PHP-DB] Re: Compiling Oracle support, error messages

2002-05-28 Thread Hubert ADGIE
Hi, With Oracle, 'til 7.3.4, server accept connection from any client. On the other hand newer release (sure for 8i) cant accept connection for 7.3.4 client but not by default. As you use a 9i client on a 7.3.4 server, you shouldn't encounter pbs. At 28/05/2002 12:39, Herbert Groot Jebbink wro

[PHP-DB] Re: Compiling Oracle support, error messages

2002-05-28 Thread Herbert Groot Jebbink
Herbert Groot Jebbink wrote: > I think I need --with-oracle and not --with-oci8 because the Oracle > server is 7.3.4, if I replace --with-oracle with --with-oci8 then > I get the error message: > In file included from internal_functions.c:34: > /www/src/php-4.2.1/ext/oci8/php_oci8.h:52: oci.h

[PHP-DB] Compiling Oracle support, error messages

2002-05-28 Thread Herbert Groot Jebbink
Hi, I'm porting a PHP application from Windows to Linux, the PHP script uses a Oracle server on a HP unix system and PHP.ini is configured to use the module php_oracle.dll (not phpoci8.dll) I can't get it to compile on Linux, the configure command works fine, the make command gives the next err