Re: [PHP-DB] PHP mail() question?

2003-04-02 Thread rolf vreijdenberger
function
htmlemailheaders($from=somename[EMAIL PROTECTED],$CC=,$BCC=){
//three arguments, last two optional
// http://www.mindspring.com/~mgrand/mime.html voor mime specificaties
 $mailheaders = NULL;//initi
 $mailheaders .= From: $from\r\n;//waarde van eerste argument van de
functie
 $mailheaders .= Reply-To: $from\r\n;
 //$mailheaders .= Return-Path: $from\r\n;
 //$mailheaders .= Return-Receipt-To: $from\r\n;
 $mailheaders .= MIME-Version: 1.0 \r\n;   //
 $mailheaders .= X-Mailer: Register PHP by DPDK\r\n; //mailer
 $mailheaders .= X-Priority: 3\r\n; //1 UrgentMessage, 3 Normal
 $mailheaders .= Content-type: text/html;charset=us-ascii
\r\n;//charset=iso-8859-1
 $mailheaders .= Content-Transfer-Encoding: 7bit \r\n;
//add more headers
 if($CC!=)
 {
  $mailheaders .= Cc: $CC\r\n;//tweede argument, alleen toevoegen als
er een waarde voor is
 }
 if($BCC!=)
 {
  $mailheaders .= Bcc: $BCC\r\n;//derde argument, BCC altijd achteraan de
headers
 }
 return $mailheaders;//function returns the headers, either store them in
variable or use in php mail() function
}//end function
htmlemailheaders()-




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



[PHP-DB] Re: Date format in MySQL

2003-02-03 Thread rolf vreijdenberger


the function you need is
DATE_FORMAT()

select event, DATE_FORMAT(my_time,'%d-%m-%Y) as mytime From mytable;

mytime will be in the form dd-mm-, the %d specifier will give you the
prefferred output



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




[PHP-DB] Re: select only where 2 things are true

2002-12-13 Thread rolf vreijdenberger

SELECT jouw_id
FROM A AS A1, A AS A2
WHERE A1.merkid=1
AND A2.merk_id=2
AND A1.jouw_id=A2.jouw_id

this is a self join!
thanks to vincent @ www.yapf.net



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




[PHP-DB] select only where 2 things are true

2002-12-11 Thread rolf vreijdenberger

A
your_id
brand_id

B
brand_id
description

A is filled with this data
1-1, 1-2, 2-2, 3-1, 3-2

how to get the your_id's with description of the brand where there are more
brand_id's to a your_id

with the next query i can get the data out with a where clause, but I want
to select only the combo's

select A.your_id as id, B.description from A  left join B  on
A.brand_id=B.brand_id

what do i have to add, or do I have to use a subquery (fi so, i use mysql,
so I have to make temporary table)

so the output I want would be only 1 ( as it has two brand_id's, and 3 (
also 2 brand_id's))

thanks in advance



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




[PHP-DB] multiple table inserts at the same time

2002-12-07 Thread rolf vreijdenberger
hi there,

I have multiple tables in my mysql db.
Users register, and after submitting there are multiple tables that need
inserts.

What is the best way to do this? speedwise, efficiencywise, codewise?
(pseudo code)

A) $sql[]='insert1';
$sql[]='insert2';
$sql[]='insert3';
foreach($sql as $doMe){
mysql_query($doMe);//i left safety checks aside for clarity
}

B)$sql='insert1';
mysql_query($sql);
$sql='insert2';
mysql_query($sql);
$sql='insert3';
mysql_query($sql);

I'd prefer the first method, as it makes for easier updating of the queries
in a centralized place.
but I am wondering what your methods are, and any advantages or
disadvantages known to you.

thanks a lot



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




Re: [PHP-DB] calling function on submit instead of going to a new script

2002-12-06 Thread rolf vreijdenberger


or use javascript, this really keeps you on the same page



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




[PHP-DB] Re: Newbie-Question: What's that @?

2002-10-31 Thread rolf vreijdenberger
there is no difference between the two!
quote: 
@mysql_query($query)
and
@mysql_query($query)?

haha
but seriously, the @ supresses error messages from php, so these will not be
outputted.
No information on why or how, the query in this case, it failed.
you can do this on a per function basis with the @ or for the whole script
with error_reporting() function.

--
Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719
E: [EMAIL PROTECTED]
W: www.depannekoekendekale.nl
Marcus Fleige [EMAIL PROTECTED] schreef in bericht
news:php.db-22830;news.php.net...
hi there,

i've got a general question about php-scripts:

whats the difference between

@mysql_query($query)

and

@mysql_query($query)?

is it the same as in batch programming?
like, ignore all return messages?

thanks and greetings from germany,

marcus

--
^v^
[EMAIL PROTECTED]




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




Re: [PHP-DB] need help with SHOW Colums

2002-10-31 Thread rolf vreijdenberger

$table=user;
  $query =   SHOW COLUMNS FROM $user ;
 
  $result = mysql_query ( $query ) or die( mysql_error () );
 
  while ( $row = mysql_fetch_array ($result) ){
 
  $x = 0 ;// i don't know what you're trying to do here, but it's wrong!!
It keeps resetting$x to zero and does nothing with the update
 
  echo $row[$x] ;
 
  $x++ ;//
  }



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




[PHP-DB] checking data from a flash movie at my domain for an insert

2002-10-23 Thread rolf vreijdenberger
is it possible to make sure data that will be inserted into a database is
from a flash movie ( a game) residing on my domain?
The data will be linked to prizes, so I want to be able to make sure that
nobody executes a script and provides false data.
The security measures I have now are encrypting strings client side (flash)
and decrypting server side (php), only sending post vars, and sending
obscure variables hidden deep in the flash movie, plus checking for the
right ( or emtpy) value of http_referrer and checking for a cookie var that
is set in the php page that embeds flash. So it's an
I'll-make-it-annoying-but-not-impossible kind of thing.
The reason I'm asking is because flash movies can be decompioled so the
algorithm for encrypting can be decoded easily.

thanks

--
Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719
E: [EMAIL PROTECTED]
W: www.depannekoekendekale.nl



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




[PHP-DB] f

2002-10-18 Thread rolf vreijdenberger
f



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




[PHP-DB] Re: f

2002-10-18 Thread rolf vreijdenberger
sorry about the message, I accidently sent it



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