I have the following problem, please help me. Many thanks.
Script 1:
___
2.inc:
// This script will switch the brower to script2.php
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 tim
On Saturday 06 September 2003 06:01, Darryl wrote:
> I have some php code that pulls from the mysql database. Here it is:
>
> mysql_connect("wildcat.osborneindustries.com", "webuser",
> "webpass");
>$mymonth = date('n');
>$cyear = date('Y');
> $query = "SELECT name,hdat
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 same
Greetings,
I have some php code that pulls from the mysql database. Here it is:
";
while ($r = mysql_fetch_array($result)) {
$name = $r["name"];
$hyear = date('Y',$r["hdate"]);
$timein = $cyear - $hyear;
if ($timein > 0) {
echo
"$name$timein
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)
>
> CR
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 MSSQL Books Online I found this:
A. Use the IDENTITY property with CREATE TABLE
This example creates a new table using the IDENTIT
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 exa
When you have an auntoincremente field in your table, you don't have to especify 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, lande
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 Databa
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
seperatel
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.
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, shut_
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 i
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-
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 t
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.
Shaun wrote:
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?
Learn SQL, please.
SELECT COUNT(co
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. Pr
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 ne
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
5
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 specify
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 t
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:
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' ";
>
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
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:
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[]",
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 variabl
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 persi
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 Mail
On Friday 05 September 2003 16:55, [EMAIL PROTECTED] wrote:
> 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...
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 read
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 fo
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 n
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.
--
P
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
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 (preg_match('/\.TX
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)
Thank
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 the
40 matches
Mail list logo