Re: [PHP-DB] Another new PHP programmer question...

2008-01-04 Thread Daniel Brown
On Jan 3, 2008 3:56 AM, Ben Stones <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Thank you for your help previously everyone, I was able to fix that problem.
> The thing now, is that I want to add smileys to the messages; i.e. :) would
> equal to a smiley image when posting a message.

Where you want that, add this:

 'smile',
':)' => 'smile',
';-)' => 'wink',
';)' => 'wink',
':-P' => 'tongue',
':P' => 'tongue');

foreach($smile as $p => $v) {
// The following is done to allow the regexp to function normally.
$p = str_replace(')','\)',str_replace('(','\(',$p));
$post = preg_replace('/'.$p.'/U','',$post);
}
?>

This assumes that you have smiley images in /graphics/smileys/ and
that they're .gif images named as shown in the second part of each
array item.

Also, keep in mind that, before you insert ANY user-posted data
into your database, you should escape it.  For example:

$post = mysql_real_escape_string($post);

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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



[PHP-DB] undefined function Mysql_connect()

2008-01-04 Thread Lukáš Moravec
Hi,

I am using (trying to use) Mysql_connect () function in my scripts and =
it=B4s not working...

 

When I will try to use this example:

 



 

It will do nothing in browser, and when I try to look at "preview" in
application HTML-Kit, which I use for script writing, it prints:

 

PHP Fatal error: Call to undefined function Mysql_connect().

 

Probably this message is reason of bad installation or some problem with
setup of PHP I guess, but...

I do not know how to solve this problem.

 

I am running Windows XP PRO,

Appache 2.0

PHP 5.2.5 as a module,

And MYSql 5.0 as a service...

 

Do you have any idea how to solve this problem?

 

Thanx Lukas