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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
anuopassion
Forum Newbie
Posts: 3
Joined: Fri Nov 06, 2009 2:43 am

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

Post 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
Attachments
runway.rar
Accessories are the codes!
(2.36 KiB) Downloaded 37 times
anuopassion
Forum Newbie
Posts: 3
Joined: Fri Nov 06, 2009 2:43 am

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

Post 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"
);
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

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

Post 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
There are 10 types of people in this world, those who understand binary and those who don't
anuopassion
Forum Newbie
Posts: 3
Joined: Fri Nov 06, 2009 2:43 am

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

Post 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 !
Post Reply