Robert,
The easiest way to convert result set values to the field variable names
is with one line of code:
extract(mysql_fetch_array($row));
This will set $firstname = $row["firstname"], etc.
Dan
--
~~~~~~~
Dan Fitzpatrick
Overhaul Se
Stefan,
Depending on your load, you could save the results in a database table,
make the table name a session variable, and just have the sorting column
names be fields in the saved table.
CREATE TABLE Q1234 AS SELECT ...;
You can also put all the variables in a variable then put the new
variab
B,
Do your first query, then run this (for one record returned).
while($row = ifx_fetch_row($query_result_id)) {
for(reset($row); $fieldname=key($row); next($row)) {
$$fieldname = $row[$fieldname];
}
}
Do your second query.
The while statement w
Jor,
You will need to have the Informix environment variables defined in your
shell environment:
INFORMIXDIR
INFORMIXSERVER
Make sure that the command line PHP binary you are using is compiled
with Informix support.
Dan
>Subject: Command line PHP + DB access
> Date: Fri, 18 May 2001 11:08
Nick,
Use the group by function:
SELECT items.itemId, description, link, sum(qty) AS total_qty,
sum(price) AS total_price FROM carts, items
WHERE carts.custId = '$custId' AND items.itemId = carts.itemId
GROUP BY items.itemId, description, link
You'll have to change the reference to the followi
I assume that the username field is text. You need to add single quotes
around the field.
$validate = mysql_query("SELECT username, user_password FROM users
WHERE username='".$uname."'",$db);
OR simply:
$validate = mysql_query("SELECT username, user_password FROM users
WHERE username='$uname'",
Matt,
I recommend using separate style sheets. This is especially important
when your users are browsing a record set, say 10 records at a time.
There is no need to pass them the style sheet embedded in the PHP page
for every page view. If the stylesheet is a file on the file system, it
is more e
Jon,
Try the following:
Use the sysmaster DB. Then:
SELECT tabname
FROM systabnames
WHERE dbsname = '$your_db_name'
[ AND owner <> 'informix' ] <- Assuming you were not logged in as
informix when you created the tables
[ AND tabname NOT LIKE ' %' ] <- If you use blobs you may have some
numeri
Norman,
The SQL statement is this:
select s.first_name AS s_name, t.first_name AS t_name, f.date from
members s, members t,
schedule f where s.first_name=f.member1 and t.first_name=f.member2
The AS is optional but it works the same as aliasing table names in the
FROM clause.
$s_name | $t_name