Page 1 of 1

Help me!I have a problem when i tried to use php!

Posted: Fri Nov 06, 2009 2:50 am
by anuopassion
Hello,
My name is zhuxiaoquan,I come from china.It`s my first time to study php+mysql,yesday,I try an example of the book "Build Your Own Database Driven Web Site.pdf".when i try to run apache ,an error came up!I rellay have no idea! Hellpme! I have poor English skills !
"An unhandled win32 exception occurred in httpd.exe[4048]",for this I tried to unistall vs 2008.

the code:

Code: Select all

 
//query
$result = mysqli_query($link, 'SELECT  id,joketext FROM joke');//1
if (!$result)
{
$error = 'Error fetching jokes: ' . mysqli_error($link);
include 'error.html.php';
exit();
}
//
//loop
while ($row = mysqli_fetch_array($result))
{
$jokes[] = array("id" => $row['id'], "text" => $row['joketext']);
}
 
 

the error with the code above will occurred. but when I use the sql "'SELECT joketext FROM joke'" without id,the error Disappeared ! so . I won`t get id that I cant perform the delete Functions !

Accessories are the codes!

Do you know why ?Tell me ,Thank you!




2009-11-06

--------------------------------------------------------------------------------

country:China,
city:Beijing,

name:zhuxiaoquan(???)
msn:54zhuxiaoquan@gmail.com

Re: Help me!I have a problem when i tried to use php!

Posted: Fri Nov 06, 2009 2:56 am
by anuopassion
# Code to create a simple joke table

CREATE TABLE joke (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
joketext TEXT,
jokedate DATE NOT NULL
) DEFAULT CHARACTER SET utf8;
# Adding jokes to the table
INSERT INTO joke SET
joketext = 'Why did the chicken cross the road? To get to the other
side!',
jokedate = '2009-04-01';
INSERT INTO joke
(joketext, jokedate) VALUES (
'Knock-knock! Who\'s there? Boo! "Boo" who? Don\'t cry; it\'s only a
joke!',
"2009-04-01"
);

Re: Help me!I have a problem when i tried to use php!

Posted: Fri Nov 06, 2009 3:18 am
by VladSun
It's a well known issue and discussed here more. PHP (special its extension modules) is mostly bloating the server when PHP runs as module.

It is advised to try to run php with mod_fcgid (Fastcgi)

There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, php is not shutting down or restarting Apache anymore.

You can also try upgrading your php to the latest version

Re: Help me!I have a problem when i tried to use php!

Posted: Fri Nov 06, 2009 4:07 am
by anuopassion
VladSun wrote:
It's a well known issue and discussed here more. PHP (special its extension modules) is mostly bloating the server when PHP runs as module.

It is advised to try to run php with mod_fcgid (Fastcgi)

There are advantages to running PHP with FCGI. Separating the PHP code from the web server removes 'bloat' from the main server, and improves the performance of non-PHP requests. Secondly, having one permanent PHP process as opposed to one per apache process means that shared resources like persistent MySQL connections are used more efficiently. And maybe even more important is stability, php is not shutting down or restarting Apache anymore.

You can also try upgrading your php to the latest version


Thank you !I will try it !