Re: [PHP] PHP want not write in Database

2011-05-16 Thread Silvio Siefke
Hello, On Mon, 16 May 2011 07:13:19 +0100 Ashley Sheridan wrote: > What is your code in the included db.html? You do realise that unless > you've told the server especially that it won't know to parse your HTML > files for PHP code as well. HTML is embedded in PHP, not the other way > around. If y

Re: [PHP] PHP want not write in Database

2011-05-16 Thread Silvio Siefke
Hello, On Mon, 16 May 2011 09:57:23 +0800 xianhua zhou wrote: > VALUES(:autor, :title, :teaser, :teaser, :content, :category, :bild) > > There are 2 ":teaser", try remove one. Yes thats it. Now it work well done! Thank you, im sorry sure was to long at the pc yesterday. Silvio -- PHP Gener

Re: [PHP] PHP want not write in Database

2011-05-16 Thread Stuart Dallas
On Mon, May 16, 2011 at 10:30 AM, Silvio Siefke wrote: > Hello, > > On Mon, 16 May 2011 09:57:23 +0800 xianhua zhou wrote: > > VALUES(:autor, :title, :teaser, :teaser, :content, :category, :bild) > > > > There are 2 ":teaser", try remove one. > > Yes thats it. Now it work well done! Thank you, im

Re: [PHP] PHP want not write in Database

2011-05-16 Thread Silvio Siefke
Hello, On Mon, 16 May 2011 11:06:17 +0100 Stuart Dallas wrote: > In order to avoid this problem in future I encourage you to check the return > value of every function call you make that might fail, i.e. every single > one! Had you done that here, and then pulled out the last error message from >

Re: [PHP] PHP want not write in Database

2011-05-16 Thread Stuart Dallas
On Mon, May 16, 2011 at 11:40 AM, Silvio Siefke wrote: > Hello, > > On Mon, 16 May 2011 11:06:17 +0100 Stuart Dallas wrote: > > In order to avoid this problem in future I encourage you to check the > return > > value of every function call you make that might fail, i.e. every single > > one! Had y

Re: [PHP] PHP want not write in Database

2011-05-16 Thread Silvio Siefke
Hello, On Mon, 16 May 2011 12:07:37 +0100 Stuart Dallas wrote: > Not all functions raise PHP errors when they fail, in fact most don't. Most > will return an error value, and a few throw exceptions. > > As the manual states, the execute method you're using will return true if it > succeeded or fa

[PHP] mysql insert internal server error 500

2011-05-16 Thread Grega Leskovšek
$ime=$_COOKIE['user']; $dolgF=filesize($filename) INSERT INTO `friendlyCMS`.`log` (`imepriimek`, `clock`, `action`, `onfile`, `filesize`) VALUES ( $ime, CURRENT_TIMESTAMP, 'saved',$filename, $dolgF); What is wrong with this? PS First column of the log table is idlog primary key autoincrement not n

Re: [PHP] mysql insert internal server error 500

2011-05-16 Thread Bálint Horváth
I think it's not the best place to send it but: $dolgF is not closed with ; ...and the insert is not in a variable! (And also I think it's not a good way using COOKIE in PHP because we have sessions) So the answer is: the all.. :D -or what's the full part you use for insert int this source!?

[PHP] Wierd cookie behaviour

2011-05-16 Thread Geoff Lane
Hi All, I'm scratching my head a bit here. I have a form handling script that branches dependent on whether a user has admin privileges over the application. Here's the function that tests this: function isAdmin($user){ global $chan; $query = "SELECT isadmin FROM csw_user WHERE username =

Re: [PHP] Functions/methods aliases in PHp 5.2

2011-05-16 Thread David Harkness
On Sun, May 15, 2011 at 3:15 PM, Richard Quadling wrote: > Personally, I would recommend using 1 naming convention and sticking with > it. > I wholeheartedly agree. Multiple method names is not flexibility--it's confusion and an open invitation for bugs. Plus, even with two styles you'll never sa

Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread David Harkness
You can register a shutdown function that gets called even in the case of a fatal error. We use something like this: public function init() { register_shutdown_function(array('Bootstrap', 'fatalErrorCatcher')); ... } public function fatalErrorCatcher() { $error

Re: Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Tim Streater
On 14 May 2011 at 15:05, Peter Lind wrote: > On 14 May 2011 12:33, Tim Streater wrote: >> I would like, in my app, to recover from as many run-time errors as possible, >> so that I can tidy up. And unsolicited output generated by the standard error >> system is really unhelpful as it becomes pa

Re: Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Peter Lind
On 16 May 2011 22:14, Tim Streater wrote: > On 14 May 2011 at 15:05, Peter Lind wrote: > >> On 14 May 2011 12:33, Tim Streater wrote: >>> I would like, in my app, to recover from as many run-time errors as >>> possible, >>> so that I can tidy up. And unsolicited output generated by the standard

Re: [PHP] Error recovery - fatal errors

2011-05-16 Thread Tim Streater
On 16 May 2011 at 21:34, Peter Lind wrote: > You were trying to call a method on a non-object - how do you expect > PHP to handle that if not with a fatal error? > Anyway, good to hear you solved the issue - I misunderstood what you > wanted to do (shut down in a proper fashion, not actually rec

[PHP] Consistent Class Renaming (Simple Refactoring)

2011-05-16 Thread Tony Mak
Hi there, i have following problem: Assume we have a "cron.php" which is called every hour by a cron job. This cron.php should then be used to execute other php-scripts "script1.php", "script2.php". For a pitty our server has Safe-Mode activated so we arent able to shell_exec / exec those f

[PHP] Consistent Class Renaming (Simple Refactoring)

2011-05-16 Thread Tony Mak
Hi there, i have following problem: Assume we have a "cron.php" which is called every hour by a cron job. This cron.php should then be used to execute other php-scripts "script1.php", "script2.php". For a pitty our server has Safe-Mode activated so we arent able to shell_exec / exec those f

Re: [PHP] Consistent Class Renaming (Simple Refactoring)

2011-05-16 Thread Richard Quadling
On 16 May 2011 23:12, Tony Mak wrote: > Hi there, > > i have following problem: > > Assume we have a "cron.php" which is called every hour by a cron job. This > cron.php should then be used to execute other php-scripts "script1.php", > "script2.php". > > For a pitty our server has Safe-Mode activa

Re: [PHP] Consistent Class Renaming (Simple Refactoring)

2011-05-16 Thread Paul M Foster
On Mon, May 16, 2011 at 11:05:07PM +0200, Tony Mak wrote: > Hi there, > > i have following problem: > > Assume we have a "cron.php" which is called every hour by a cron > job. This cron.php should then be used to execute other php-scripts > "script1.php", "script2.php". > > For a pitty our serv