Jump to content


Photo

Prevent an error


  • Please log in to reply
4 replies to this topic

#1 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 17 October 2006 - 10:13 AM

Can I stop this error from being shown on the browser (even though I know it exists)
v[0]=1; echo v[2];
The error is Undifined offset.

I don't want to fix the problem, I just want it not be shown...

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 17 October 2006 - 10:16 AM

use

v[0]=1;
@ echo v[2];

follow me on twitter @PHPsycho

#3 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 17 October 2006 - 10:21 AM

I get another error :parse error unexpected T_ECHO!

#4 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 17 October 2006 - 10:36 AM

Try changing the error reporting level...

<?php
error_reporting(E_ERROR);

$v[0]=1;
echo $v[2];
?>

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#5 amalosoul

amalosoul
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 17 October 2006 - 04:54 PM

Thank you very much! This worked:)!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users