[PHP] query problem.

2006-01-24 Thread Angelo Zanetti

Hi guys.

I got an entry in a field called emailfrom in my table (MySQL db).

The data in that field is: Sams Bank [EMAIL PROTECTED]

I then do the following to retrieve the info, using a DB class

$recordset=$conn-Execute(SELECT * FROM wiml_history WHERE id = $task_id);
$row=$recordset-GetArray();

$emailfrom=$row[0]['emailfrom'];

then I echo what I get out and I just get Sams Bank

It doesnt bring back the whole entry in that field,
however when I manually change the info in the field in the DB to:

Sams Bank [EMAIL PROTECTED], it retrieves it correctly.

Why does the   cause that not to be displayed? or is it retrieving it 
correctly but not showing it because of the   (which might be 
conflicting with HTML tags?


thanks in advance


--

Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052
[f] +27 86 681 5885

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



Re: [PHP] query problem.

2006-01-24 Thread David Grant
Angelo,

Angelo Zanetti wrote:
 Why does the   cause that not to be displayed? or is it retrieving it
 correctly but not showing it because of the   (which might be
 conflicting with HTML tags?

Look at the source!

David
-- 
David Grant
http://www.grant.org.uk/

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



Re: [PHP] query problem.

2006-01-24 Thread Silvio Porcellana [tradeOver]

Angelo Zanetti wrote:

(...)
Why does the   cause that not to be displayed? or is it retrieving it 
correctly but not showing it because of the   (which might be 
conflicting with HTML tags?




When showing things in an HTML page it's always a good idea to use 
'htmlspecialchars' (or htmlentities) first


http://php.net/manual/en/function.htmlspecialchars.php
http://php.net/manual/en/function.htmlentities.php

HTH, ciao!
Silvio

--
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



[PHP] RE: (SCL: 5) [PHP] query problem.

2006-01-24 Thread Duffy, Scott E
Viewing in browser? If so view source.

-Original Message-
From: Angelo Zanetti [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 25, 2006 7:01 AM
To: PHP List
Subject: (SCL: 5) [PHP] query problem.

Hi guys.

I got an entry in a field called emailfrom in my table (MySQL db).

The data in that field is: Sams Bank [EMAIL PROTECTED]

I then do the following to retrieve the info, using a DB class

$recordset=$conn-Execute(SELECT * FROM wiml_history WHERE id =
$task_id);
$row=$recordset-GetArray();

$emailfrom=$row[0]['emailfrom'];

then I echo what I get out and I just get Sams Bank

It doesnt bring back the whole entry in that field,
however when I manually change the info in the field in the DB to:

Sams Bank [EMAIL PROTECTED], it retrieves it correctly.

Why does the   cause that not to be displayed? or is it retrieving it 
correctly but not showing it because of the   (which might be 
conflicting with HTML tags?

thanks in advance


-- 

Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052
[f] +27 86 681 5885

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

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



Re: [PHP] query problem.

2006-01-24 Thread Richard Lynch
On Wed, January 25, 2006 7:01 am, Angelo Zanetti wrote:
 The data in that field is: Sams Bank [EMAIL PROTECTED]
.
.
.
 Why does the   cause that not to be displayed? or is it retrieving
 it
 correctly but not showing it because of the   (which might be
 conflicting with HTML tags?

You have hit the nail on the head here.

If you use your browser's View Source menu, you'll see the full value.

NOTE: View Source is ALWAYS a good idea when what you see is not
what you expect.

If you want to display that data as HTML data, you would use:
http://php.net/htmlentities
which will translate the special characters into HTML entities, which
will render correctly in browsers.

You should use htmlentities right before you spit out the data, and be
very careful not to confuse the data that has had htmlentities applied
with the original.

So, you might do:

$email = ... /* get mysql result here, somehow */
$email_html = htmlentiites($email);
echo Email: $email_htmlbr /\n;

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] query problem.

2006-01-24 Thread Brian V Bonini
On Wed, 2006-01-25 at 08:01, Angelo Zanetti wrote:
 Hi guys.
 
 I got an entry in a field called emailfrom in my table (MySQL db).
 
 The data in that field is: Sams Bank [EMAIL PROTECTED]
 
 I then do the following to retrieve the info, using a DB class
 
 $recordset=$conn-Execute(SELECT * FROM wiml_history WHERE id = $task_id);
 $row=$recordset-GetArray();
 
 $emailfrom=$row[0]['emailfrom'];
 
 then I echo what I get out and I just get Sams Bank
 
 It doesnt bring back the whole entry in that field,
 however when I manually change the info in the field in the DB to:
 
 Sams Bank [EMAIL PROTECTED], it retrieves it correctly.
 
 Why does the   cause that not to be displayed? or is it retrieving it 
 correctly but not showing it because of the   (which might be 
 conflicting with HTML tags?
 
 thanks in advance


$emailfrom = htmlspecialchars($row[0]['emailfrom']);



-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] RE: (SCL: 5) [PHP] query problem.

2006-01-24 Thread Richard Correia
Remove those brackets  and .

Or

print htmlentities($email_address);

Thanks
Richard

On 1/24/06, Duffy, Scott E [EMAIL PROTECTED] wrote:

 Viewing in browser? If so view source.

 -Original Message-
 From: Angelo Zanetti [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 25, 2006 7:01 AM
 To: PHP List
 Subject: (SCL: 5) [PHP] query problem.

 Hi guys.

 I got an entry in a field called emailfrom in my table (MySQL db).

 The data in that field is: Sams Bank [EMAIL PROTECTED]

 I then do the following to retrieve the info, using a DB class

 $recordset=$conn-Execute(SELECT * FROM wiml_history WHERE id =
 $task_id);
 $row=$recordset-GetArray();

 $emailfrom=$row[0]['emailfrom'];

 then I echo what I get out and I just get Sams Bank

 It doesnt bring back the whole entry in that field,
 however when I manually change the info in the field in the DB to:

 Sams Bank [EMAIL PROTECTED], it retrieves it correctly.

 Why does the   cause that not to be displayed? or is it retrieving it
 correctly but not showing it because of the   (which might be
 conflicting with HTML tags?

 thanks in advance


 --




[PHP] Query problem

2002-11-12 Thread Cesar Aracena
Hi all,

I came back from vacations and forgot some things about queries... can
anyone tell me what is wrong with this? of all the error messages I set up
in the script, none comes back on the page but the record is not saved...

?

$db = mysql_connect(www.icaam.com.ar, icaam, );
if (!$db)
{
 die(No se pudo abrir la base de datos);
}

$ok = mysql_select_db(icaam);
if(!$ok)
{
 die(No se pudo acceder a la base de datos);
}

$borndate = $bornd . $bornm . $borny;
$phonenumber = $phone;

$query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c',
'c', 12, 'c');
$result = mysql_query($query) or die (mysql_errno());
if (mysql_affected_rows() != 1)
{
 die(Fallo al guardar datos);
}

echo Gracias por administrarnos su información.;

?

Any thiughts? Thanks in advance,

Cesar



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




Re: [PHP] Query problem

2002-11-12 Thread BigDog
In your php.ini file you can turn on all the errors have have them
displayed...

I would suggest doing that and you should see some errors if there are
any.

Have you verified that dates in the database via mysql command line or
gui application.


On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
 Hi all,
 
 I came back from vacations and forgot some things about queries... can
 anyone tell me what is wrong with this? of all the error messages I set up
 in the script, none comes back on the page but the record is not saved...
 
 ?
 
 $db = mysql_connect(www.icaam.com.ar, icaam, );
 if (!$db)
 {
  die(No se pudo abrir la base de datos);
 }
 
 $ok = mysql_select_db(icaam);
 if(!$ok)
 {
  die(No se pudo acceder a la base de datos);
 }
 
 $borndate = $bornd . $bornm . $borny;
 $phonenumber = $phone;
 
 $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
 address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c',
 'c', 12, 'c');
 $result = mysql_query($query) or die (mysql_errno());
 if (mysql_affected_rows() != 1)
 {
  die(Fallo al guardar datos);
 }
 
 echo Gracias por administrarnos su información.;
 
 ?
 
 Any thiughts? Thanks in advance,
 
 Cesar
-- 
.: B i g D o g :.



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




Re: [PHP] Query problem

2002-11-12 Thread Cesar Aracena
The problem is that I have a remote rented server and I don't have access
to these configurations

any other ideas are welcome. Thanks

any ot

- Original Message -
From: BigDog [EMAIL PROTECTED]
To: Cesar Aracena [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Tuesday, November 12, 2002 11:51 AM
Subject: Re: [PHP] Query problem


 In your php.ini file you can turn on all the errors have have them
 displayed...

 I would suggest doing that and you should see some errors if there are
 any.

 Have you verified that dates in the database via mysql command line or
 gui application.


 On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
  Hi all,
 
  I came back from vacations and forgot some things about queries... can
  anyone tell me what is wrong with this? of all the error messages I set
up
  in the script, none comes back on the page but the record is not
saved...
 
  ?
 
  $db = mysql_connect(www.icaam.com.ar, icaam, );
  if (!$db)
  {
   die(No se pudo abrir la base de datos);
  }
 
  $ok = mysql_select_db(icaam);
  if(!$ok)
  {
   die(No se pudo acceder a la base de datos);
  }
 
  $borndate = $bornd . $bornm . $borny;
  $phonenumber = $phone;
 
  $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
  address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c',
'c',
  'c', 12, 'c');
  $result = mysql_query($query) or die (mysql_errno());
  if (mysql_affected_rows() != 1)
  {
   die(Fallo al guardar datos);
  }
 
  echo Gracias por administrarnos su información.;
 
  ?
 
  Any thiughts? Thanks in advance,
 
  Cesar
 --
 .: B i g D o g :.





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




Re: [PHP] Query problem

2002-11-12 Thread rija
$query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
address, city, country, phone, how) VALUES (null, 'c', 'c', '12', 'c', 'c',
'c', '12', 'c');

I think you should put quotes around all of these values 12 exept null or
change null to '' ///


- Original Message -
From: Cesar Aracena [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 8:27 AM
Subject: [PHP] Query problem


 Hi all,

 I came back from vacations and forgot some things about queries... can
 anyone tell me what is wrong with this? of all the error messages I set up
 in the script, none comes back on the page but the record is not saved...

 ?

 $db = mysql_connect(www.icaam.com.ar, icaam, );
 if (!$db)
 {
  die(No se pudo abrir la base de datos);
 }

 $ok = mysql_select_db(icaam);
 if(!$ok)
 {
  die(No se pudo acceder a la base de datos);
 }

 $borndate = $bornd . $bornm . $borny;
 $phonenumber = $phone;

 $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
 address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c', 'c',
 'c', 12, 'c');
 $result = mysql_query($query) or die (mysql_errno());
 if (mysql_affected_rows() != 1)
 {
  die(Fallo al guardar datos);
 }

 echo Gracias por administrarnos su información.;

 ?

 Any thiughts? Thanks in advance,

 Cesar



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





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




RE: [PHP] Query problem

2002-11-12 Thread Davy Obdam
Hi Cesar,

 Hi all,
 
 I came back from vacations and forgot some things about 
 queries... can anyone tell me what is wrong with this? of all 
 the error messages I set up in the script, none comes back on 
 the page but the record is not saved...

Dont we all forget 'things' after vacations eh? ;-)
I think you forgot a ' somewhere...

$query = INSERT INTO mararegistro (visitorid, fname, lname, 
 borndate, address, city, country, phone, how) VALUES (null, 
'c', 'c', '12', 'c', 'c', 'c', 12, 'c');

You forgot to put single qoutes around 12. Now it should work

Best regards,
 
Davy Obdam
mailto:info;davyobdam.com




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




Re: [PHP] Query problem

2002-11-12 Thread Ernest E Vogelsinger
At 23:35 12.11.2002, Cesar Aracena said:
[snip]
The problem is that I have a remote rented server and I don't have access
to these configurations

any other ideas are welcome. Thanks

any ot

- Original Message -
From: BigDog [EMAIL PROTECTED]

 In your php.ini file you can turn on all the errors have have them
 displayed...
[snip] 

You may always do two things to spot any error like this:

a) set error_reporting to a value where the error will be shown, e.g.
   error_reporting(E_ALL | ~E_NOTICE);
   This will override the INI file for the script instance

b) cluster your code with echo statements to see the value of certain
variables.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] Query problem

2002-11-12 Thread rija
error_reporting() ;

  1 E_ERROR
  2 E_WARNING
  4 E_PARSE
  8 E_NOTICE
  16 E_CORE_ERROR
  32 E_CORE_WARNING
  64 E_COMPILE_ERROR
  128 E_COMPILE_WARNING
  256 E_USER_ERROR
  512 E_USER_WARNING
  1024 E_USER_NOTICE


- Original Message -
From: Cesar Aracena [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Wednesday, November 13, 2002 9:35 AM
Subject: Re: [PHP] Query problem


 The problem is that I have a remote rented server and I don't have
access
 to these configurations

 any other ideas are welcome. Thanks

 any ot

 - Original Message -
 From: BigDog [EMAIL PROTECTED]
 To: Cesar Aracena [EMAIL PROTECTED]
 Cc: PHP General [EMAIL PROTECTED]
 Sent: Tuesday, November 12, 2002 11:51 AM
 Subject: Re: [PHP] Query problem


  In your php.ini file you can turn on all the errors have have them
  displayed...
 
  I would suggest doing that and you should see some errors if there are
  any.
 
  Have you verified that dates in the database via mysql command line or
  gui application.
 
 
  On Tue, 2002-11-12 at 21:27, Cesar Aracena wrote:
   Hi all,
  
   I came back from vacations and forgot some things about queries... can
   anyone tell me what is wrong with this? of all the error messages I
set
 up
   in the script, none comes back on the page but the record is not
 saved...
  
   ?
  
   $db = mysql_connect(www.icaam.com.ar, icaam, );
   if (!$db)
   {
die(No se pudo abrir la base de datos);
   }
  
   $ok = mysql_select_db(icaam);
   if(!$ok)
   {
die(No se pudo acceder a la base de datos);
   }
  
   $borndate = $bornd . $bornm . $borny;
   $phonenumber = $phone;
  
   $query = INSERT INTO mararegistro (visitorid, fname, lname, borndate,
   address, city, country, phone, how) VALUES (null, 'c', 'c', 12, 'c',
 'c',
   'c', 12, 'c');
   $result = mysql_query($query) or die (mysql_errno());
   if (mysql_affected_rows() != 1)
   {
die(Fallo al guardar datos);
   }
  
   echo Gracias por administrarnos su información.;
  
   ?
  
   Any thiughts? Thanks in advance,
  
   Cesar
  --
  .: B i g D o g :.
 
 
 


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





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