Hey guys,

I was just installing the PHP on my laptop. And, on one of the windows, it is asking me if I want the wizard to setup a web server. Do I need one? There is a list: IIS FastCGI, Other CGI, or Do not setup a Web Server.
Which one should I choose? And why?
Could someone help me out on this?

Thanks!

Member Avatar for diafol

Are you just installing PHP or a stack (e.g. XAMPP)?
XAMPP (my preference) should take care of most of it for you - setup an Apache web server. I run it on Win7

i was downloading and installing PHP, APACHE, and MYSQL separately. Or should I redo it and do it with XAMPP or WampServer?

Member Avatar for diafol

Using a stack is certainly easier. I couldn't advise you on separate installations as I've never had to do that.

ardav, I installed the XAMPP, too. It was way more easier. Thanks.

I am a bit new to this PHP and MySql stuff. I want to learn more about them.
Right now, I am trying to create one simple web window with a simple form (address, city, name). I created a database with a table that has all the fields. But, I am having trouble connecting my PHP with MySql database.
What are the steps that I need to take after creating the database? I think I got myself confused.

Member Avatar for diafol

It's usually set up ready to go (from the manual):

$link = mysql_connect('localhost', 'root', '');
if (!$link) {
    die('Not connected : ' . mysql_error());
}

// select your db name (foo in this example) 
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
}

now you can access the db data:

$query = "SELECT ...";
$result = mysql_query($query);
if(mysql_num_rows($result)){
   while($data = mysql_fetch_array($result)){
      echo $data['somefield'] . "< br />";
   }
}

never mind, guys. just got my php connected. :)

just saw your comment, ardav. Thank you for the help.
for future references, do I need to save my .php file within that XAMPP folder always?

Member Avatar for diafol

ok, solved? mark it so.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.