[PHP-DB] Php-Mysql, select and update trouble

2004-06-27 Thread Alessandro Folghera
Dear Phpers,

I have the following part of a script that retrieve an URL site. I'd like
to count the clicks for every URL. I have added to mysql table a column
hit. May anybody tell me how to insert into an sql selection also an
update, referring to the HIT variable (i.e. to realize a select and update
together) ?

This is the select I'm using:

? 
require(../connection.php); 
$link = mysql_connect($host,$user,$password);
$result=mysql_db_query($base,select url from .$baseofsites. where
id=.$s. ,$link);
$url = mysql_result($result,0,url);
header(Location: .$url.);
exit();  
?

This should be (I suppose) the sql update I must include ... UPDATE
table.sites SET hit = hit + 1 WHERE id=$s 

Thanks for all, Alessandro

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Auto increament

2004-06-27 Thread Rinku
Can any of you guide me how to do auto increament in a field?
I think there is one datatype for auto increament.
But I dont know how to do it ?
 
Rinku


-
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

[PHP-DB] Re: Auto increament

2004-06-27 Thread Torsten Roehr
Rinku [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Can any of you guide me how to do auto increament in a field?
 I think there is one datatype for auto increament.
 But I dont know how to do it ?

Here is everything you need to know:
http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html
(Seatch for AUTO_INCREMENT in the text)

Please do a bit more reasearch on your own before posting to the list.
Thanks.

Regards, Torsten Roehr

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Auto increament

2004-06-27 Thread Larry E . Ullman
Can any of you guide me how to do auto increament in a field?
I think there is one datatype for auto increament.
But I dont know how to do it ?
I'd start by reading the manual and documentation for the database 
application being used. But, generally, auto incremented fields are 
primary keys, unsigned, not null integers. For MySQL, in particular, 
you define a field as auto increment by using AUTO_INCREMENT. Again, 
you can see the manual for more.

Larry
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Dates and Count

2004-06-27 Thread Shannon Doyle
Hi People,

I have two queries for the list:-

First, I have two dates stored in a MySQL DB that I want to do a compare on
and then only display via a web page those records that have a 5 or greater
day difference in them. What would be the best way to achieve this.


Second, I want to be able to return a list of 'clients' from the MySQL DB
that have a specific number of a particular type of entry associated with
them. I am assuming that the 'count' would be used, but how would I first
display this count, and second only return those that have the number of
entries that I am looking for.

Thanks in advance

Shannon

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Call to undefined function mysql_connect()

2004-06-27 Thread Leandro de Oliveira
Hi!
 
I want test MySQL with PHP, for that I wrote this:
 
html
headtitleTest MySQL/title/head
body
?php
$con = mysql_connect(localhost, lehphyro, );
$success = mysql_select_db(mysql, $conexao);
if ($success  0)
 echo Success!!;
else {
 echo Failure!!;
 echo mysql_error();
}
?
/body
/html
 
But i received Call to undefined function mysql_connect() on line 5
 
Can anyone help me?
 
Thanks!



-
Crie seu Yahoo! Mail, agora com 100MB de espaço, anti-spam e antivírus grátis!

Re: [PHP-DB] Call to undefined function mysql_connect()

2004-06-27 Thread Larry E . Ullman
But i received Call to undefined function mysql_connect() on line 5
Can anyone help me?
Your PHP installation apparently does not support MySQL. You can 
confirm this by running a phpinfo() script. You may need to 
reinstall/recompile PHP.

Larry
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Auto increament

2004-06-27 Thread Daniel Clark
Yes there is an auto increment field in mySQL and most other databases.

Can any of you guide me how to do auto increament in a field?
I think there is one datatype for auto increament.
But I dont know how to do it ?
 
Rinku

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Call to undefined function mysql_connect()

2004-06-27 Thread Cole S. Ashcraft
Create a page called phpinfo.php. In it put ?php phpinfo() ?. Search 
for MySQL. You probably don't have MySQL support in your installation.

Cole
Leandro de Oliveira wrote:
Hi!
I want test MySQL with PHP, for that I wrote this:
html
headtitleTest MySQL/title/head
body
?php
$con = mysql_connect(localhost, lehphyro, );
$success = mysql_select_db(mysql, $conexao);
if ($success  0)
echo Success!!;
else {
echo Failure!!;
echo mysql_error();
}
?
/body
/html
But i received Call to undefined function mysql_connect() on line 5
Can anyone help me?
Thanks!

-
Crie seu Yahoo! Mail, agora com 100MB de espaço, anti-spam e antivírus grátis!
 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is believed to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php