Probably a simple query, but gogle has turned up good, but not specific
info...
I have a data capture form, that I wanna view the results of.
All good, I've built a results page, that fitlers by many different
catagories etc...
what I'd like to do now, is have two date fields to sort by, and
Hi all,
I need a small script of php selecting all the files in a directory and
putting the names in an array.
Also, selecting a specific type might be helpfull like *.TXT
I tried to write on my own but it is not a success yet :))
Anyone to help?
I will use it on Win32 (2000 pro and XP)
On Fri, 5 Sep 2003, FB wrote:
} I need a small script of php selecting all the files in a directory and
} putting the names in an array.
}
} Also, selecting a specific type might be helpfull like *.TXT
Untested:
$dir = dir('/your/dir/here');
while ($file = $dir-read()) {
if
There are many good user-contribued examples in the online PHP manual at
function readdir()
Ignatius
_
- Original Message -
From: FB [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 05, 2003 11:55 AM
Subject: [PHP-DB] all files in a directory
Hi
Hi,
I have a table in my database called Users. This table has (among others)
two columns called Location and Name. Location will be either 1, 2, 3, or 4.
How can I produce a query that groups the result into Location and then for
each Location order the User by Name?
Thanks for your help.
--
Hi!
(I'm using php3 on an apache-server)
I'm doing lika a shoppingcart where the user can put items.
By some reason, when I use setcookie, I can only save between 14-17 posts.
Example:
setcookie(items, item1);
setcookie(items, item2);
...
setcookie(items, item17);
After this it will not
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
says...
Hi,
I have a table in my database called Users. This table has (among others)
two columns called Location and Name. Location will be either 1, 2, 3, or 4.
How can I produce a query that groups the result into Location and then for
Stefan,
OK, there may be more to this (and I'm sure others will respond if there
is), but here's my best take on your problem.
You're using the PHP function setcookie() which sets a cookie in the remote
browser, not on the server (check Chapter 19 in the PHP manual for a quick
explanation or
Hi,
Is it possible to combine the COUNT AVG functions using MySQL? I have a
table called Bookings and I need to find out the average number of bookings.
So I need to count the number of bookings in the table and then get the
Average, is this possible?
Thanks for your help
--
PHP Database
On Thu, 4 Sep 2003, Balaji H. Kasal wrote:
It is usually better not to use persistenc connections.
So drop the pmysql_connect or if you really need to use
them set set max connections higher for mysql.
Which problem it has?
On a really busy site persistent
HI, i have the following problem
Im working with sql server 2000 in a windows xp pc, then in the bd i have a
table called noticias and a text type field, when i insert into the field
everything goes rigth, but when i try to get the info of teh field, i can
get all the info, is like the variable
On Friday, Sep 5, 2003, at 08:58 US/Eastern, Hutchins, Richard wrote:
If you wish to assign multiple values to a single cookie, just add []
to
the cookie name.
So if you wanted to set one cookie to hold all of your items, you
should be
able to setcookie(items[], item1), setcookie(items[],
Hell!
I'm having a small problem with modifying the data in a MySQL DB.
And here's the error:
(After I click the Submit Changes button) Error: 1064: You have an error
in your SQL syntax near '(10-10-10-10)' kwo='1235', lsd='10-10-10-10',
date='2003-05-05', well' at line 1
Here's the code:
looks like you stopped putting commas after your fields at
$field_str .= formation = '$formation' ;
$field_str .= perfs = '$perfs' ;
$field_str .= event = '$event' ;
$field_str .= fluid = '$fluid' ;
hth
Jeff
Yah, I noticed that after I had submitted this, and fixed it - still no
change - gives the same exact error.
Jeffrey N Dyke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
looks like you stopped putting commas after your fields at
$field_str .= formation = '$formation' ;
I'd suggest you first output your SQL statement to the browser to see
exactly what it's sending to the database. Might give you the answer right
there.
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 12:35 PM
To: [EMAIL PROTECTED]
Subject: Re:
K, my tired eyes last night missed a few stupid mistakes...
First: The Commas
Second: I removed the period form the first line of the array -- $field_str
= kwo = '$kwo', ;
Third: two typos.
*hangs head in shame*
Sorry for bothering everyone. :P
BUT! I'm still having a problem - when I try to
Jeff,
No problem. Happens to everyone, trust me.
Anyway, I see you're using mysql_affected_rows($link_id) to get see how many
rows were affected by the UPDATE. Try getting rid of the $link_id in the
declaration and just use mysql_affected_rows(). Personally, I have always
had trouble when
I have a php page where I would like to list a numer of companies as below:
1- retrieve all distinct company names from TableA (SELECT company_name FROM
TableA)
2- retrieve all distinct company names from TableB
3- combine the two lists as list1
4- retrieve all distinct company names from TableC
Ok, so it sorta works now *grin*
Two new problems
I added an auto increment field in my table and changed the php to reflect
that field - But for some reason, it doesn't work..
When I submit a new record, do I need to tell SQL to add one to the
greatest, or should it do it automatically when a
Jeff,
When you want to increment an autoincrement field, you just put NULL into
the query. For example:
INSERT (NULL,'Jeff','php list','Modify MySQL Record') INTO mail;
Where NULL is in the same spot in the field list as your autoincrement
field.
That concept is covered in the MySQL manual.
Shaun wrote:
I have a table in my database called Users. This table has (among others)
two columns called Location and Name. Location will be either 1, 2, 3, or 4.
How can I produce a query that groups the result into Location and then for
each Location order the User by Name?
Learn SQL, please.
I want to SELECT * from a table and also update the hit counter by 1. So
theres 2 different queries which I know I can easily do in PHP seperately,
but I thought itd be quicker and more efficient to run them in the same
query, ie seperated by a ';'.
But PHP returns an error, and it works fine on
Oz wrote:
I have a php page where I would like to list a numer of companies as below:
1- retrieve all distinct company names from TableA (SELECT company_name FROM
TableA)
CREATE TEMPORARY TABLE temp1 SELECT DISTINCT(company_name) FROM TableA
2- retrieve all distinct company names from TableB
3-
John Ryan wrote:
I want to SELECT * from a table and also update the hit counter by 1. So
theres 2 different queries which I know I can easily do in PHP seperately,
but I thought itd be quicker and more efficient to run them in the same
query, ie seperated by a ';'.
But PHP returns an error, and
Ok, so I added what you suggested, but it still doesn't assign any numbers
to the records.
$query = INSERT INTO cnrl_db (gradient, kwo, lsd, date, well, field, uni,
license, formation, perfs, event, fluid, mode, type, vhd, file, kb, grd,
open, sour, tube, landed, casing, landed2, shut_date,
Get rid of the single quotes around NULL. If you use 'NULL', it inserts the
string NULL into that column instead of a NULL which triggers the
autoincrement (think I explained that right).
If that doesn't work, echo out your query again and make sure it's sending
what it's supposed to be sending.
You wouldnt know where to change this setting?
John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
John Ryan wrote:
I want to SELECT * from a table and also update the hit counter by 1. So
theres 2 different queries which I know I can easily do in PHP
seperately,
but
John Ryan wrote:
You wouldnt know where to change this setting?
It's not a setting, you just can't do it. Use two mysql_query() calls.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals www.phparch.com
--
PHP
When you have an auntoincremente field inyour table, you don't have toespecify the field name in the query,as the following:
$query = "INSERT INTO cnrl_db (kwo, lsd, date, well, field, uni,
license, formation, perfs, event, fluid, mode, type, vhd, file, kb, grd,
open, sour, tube, landed,
Yup, Fernando is correct. But it is not incorrect to specify a NULL value in
your query for an autoincrement column. Right out of the MySQL manual:
If you insert NULL into an AUTO_INCREMENT column, the next number in the
sequence is inserted.
Although the MySQL manual implies it by giving
That's ok Richard,I posted the message'cause i haven't seen yours.
As a matter of fact. I'm really new to MySQL, my DB background is MSSQL, so, in the MSSQLBooks Online I found this:
A. Use the IDENTITY property with CREATE TABLE
This example creates a new table using the IDENTITY
This can be done in one query using subselects.
El Vie 05 Sep 2003 15:49, John W. Holmes escribi:
Oz wrote:
I have a php page where I would like to list a numer of companies as
below:
1- retrieve all distinct company names from TableA (SELECT company_name
FROM TableA)
CREATE
Greetings,
I have some php code that pulls from the mysql database. Here it is:
?php
mysql_connect(wildcat.osborneindustries.com, webuser,
webpass);
$mymonth = date('n');
$cyear = date('Y');
$query = SELECT name,hdate FROM emp2 where month(hdate)=$mymonth
order by hdate;
Hi,
I want to get a unique ID from a browser. Because i want to replace a cookie
with a row in a database (mysql), but i don't want that a user has to open a
account, so i want to refer to a unique id from the user's browser. Anybody
who knows how to get a unique Id which is the next time the
On Saturday 06 September 2003 06:01, Darryl wrote:
I have some php code that pulls from the mysql database. Here it is:
?php
mysql_connect(wildcat.osborneindustries.com, webuser,
webpass);
$mymonth = date('n');
$cyear = date('Y');
$query = SELECT name,hdate FROM
Floris wrote:
I want to get a unique ID from a browser. Because i want to replace a cookie
with a row in a database (mysql), but i don't want that a user has to open a
account, so i want to refer to a unique id from the user's browser. Anybody
who knows how to get a unique Id which is the next
I have the following problem, please help me. Many thanks.
Script 1:
?php
[EMAIL PROTECTED]($o_conn_vars[username], $o_conn_vars[password],
$o_conn_vars[db]);
//Parse sql statement
//Execute sql statement.
..
...
require('2.inc');
?
38 matches
Mail list logo