/    Sign up×
Community /Pin to ProfileBookmark

Frequently Asked Questions

This is a list of questions that are commonly asked so if you look here and you may find your answer which will save you time in waiting for other members to post replies.

Please add more as you think of them

[b]Q.[/b] How can I set up PHP or mySQL on my own Computer.

[b]A.[/b] You can either compile each part of the install your self by downloading the [url=http://httpd.apache.org/]Apache Web server[/url] then installing the [url=http://www.php.net/downloads.php]PHP parsing engine[/url] and the [url=http://dev.mysql.com/downloads/]mySQL database engine[/url].

Alternatively a All-in-one package for windows operating systems is [url=http://www.apachefriends.org/en/xampp.html]xampp[/url].


_____________________________________________________

[b]Q.[/b] My PHP script won’t go and there are no errors?

[b]A.[/b] Some times your script just will not work, and when your page is not showing any errors it’s just hard to fix. With This article Written by [b]NogDog[/b] it shows some very good points to help [url=http://www.charles-reace.com/article.html]debug those errors with Defensive Coding[/url].

[code=php]
<?php
/* In addition to that add this to the very top of your script */
@error_reporting(‘E_ALL’);
@ini_set(‘display_errors’, ‘1’);
/* This will print any errors that your page may have */
?>
[/code]


_____________________________________________________

[b]Q.[/b] How can I send mail with PHP?

[b]A.[/b]There are many resources that help you with sending mail in PHP. Direct from the [url=http://php.net/mail]PHP Website[/url], Using [url=http://www.google.com]Google[/url] or an article by a [url=http://www.webdeveloper.com/]Web Developer Forum[/url] member [url=http://bokehman.com/mime_mail_script]Bokeh, Mime Mail[/url].


_____________________________________________________

[b]Q.[/b] How do I make a Login area for my site?

[b]A.[/b] Well this is a common question and really its not that hard at all, You have two options, If you have access to mySQL then you have access to a good unlimited user secure database of users.

There are many articles on this over the net, I like this one [url=http://www.charles-reace.com/login_article.html]PHP Login the database way[/url] or search [url=http://www.hotscripts.com]Hotscripts[/url] which has hundreds of PHP Login scripts.

Another option for those who don’t have access to a mySQL database is the flat file authentication system. [url=http://www.webdeveloper.com/forum/showthread.php?t=85991]Here is a link[/url] and [url=http://www.webdeveloper.com/forum/showthread.php?t=86052]another[/url] to threads here with very good scripts. Else again [url=http://www.hotscripts.com]Hotscripts[/url] has many scripts listed.


_____________________________________________________

[b]Q.[/b] I can’t connect to my Database?

[b]A.[/b] Are your connection settings right? Sometimes you develop your scripts on your own computer, then when it comes time to upload it on to the World Wide Web nothing happens, No database connection, No queries, No Results. Then you realise you have to change one setting, so you have to edit every page, Nightmare! So I propose this. Use an external Connection script.

[code=php]
//db_connect.php

$db_server = “localhost”;
$db_user = “username”;
$db_password = “password”;
$db_name = “database”;

$db_connect = mysql_connect($db_server, $db_user, $db_password)
or die (‘I cannot connect to the database because: ‘ . mysql_error());
mysql_select_db ($db_name) or die (‘I cannot connect to $db_name because: ‘ . mysql_error());

?>
[/code]

Then just include or require it into each page where you need database access.

[code=php]
<?php
//we need to connect to the database so
require(‘db_connect.php’);
?>
[/code]

This way means if there is an error you change one script and it’s done.

Possible errors could be:
[b]Server Address[/b] the address you entered is 90% of the time localhost, if your are connecting to a remote mySQL Database then either use the domain name of the Host or the IP address. Some Remote host’s may require you to enter in a port number, If so you will need to contact your Host.

[b]Username Issues[/b] Make sure your name is correct to the name assigned to the database (case sensitive). Also make sure that the user name assigned to the db has enough permission set to do what you want it to do.

[b]Password[/b] It must be the right one, just like always and make sure it’s case sensitive.

[b]Database name[/b] You must be trying to connect to a valid database where all the location, username and password match.

as with any and every SQL query ales put this piece of code right after your request.

[code=php]echo(mysql_error());[/code]


_____________________________________________________

Now For all the newer members please note these few points;

1) Don’t title your threads “Urgent Help Needed!” , “Newbie help”, “Problem” or such un-descriptive as that.

Post with titles like explaining the error given or what you are trying to do.

2) Never say that you urgently need us to do this and that for you, We don’t get paid to do this and are helping you instead of doing our own scripting. Be considerate to us and we will help you find the right solution.

3) Use the V B Tags provided. Posting your code in [b][ php ][/b] code goes inside these tags, there not just here for looks [b][ /php ][/b]

Even the smallest piece of code should go in tags.

4)Search First, There are as of now (8:00pm, Wednesday 30th November 2005, New Zealand Time) [b]8313[/b] threads in the PHP Forum, I’m sure your question or a solution has been posted before.

[url=http://www.webdeveloper.com/forum/search.php?]SEARCH FIRST[/url]

5) New To the Forum? Read the “[url=http://www.webdeveloper.com/forum/showthread.php?t=64280]help us to help you[/url]” Sticky, It is full of the Best posting guidelines posted by the people that are here to help you.

Thank you for reading.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyMar 17.2006 — New to PHP?

[url=http://www-128.ibm.com/developerworks/opensource/library/os-php-read/]Recommended PHP reading list[/url]
Copy linkTweet thisAlerts:
@chazzyMar 24.2006 — [b]Q.[/b] Why does my script not work/Why do I only get a blank page when I use my script?

[b]A.[/b] While there is no one answer, you will get a lot more information if you turn on error reporting:
[code=php]
//add to the top of your script
ini_set('error_reporting', E_ALL);
//will only work if your host hasn't disabled it...
[/code]
Copy linkTweet thisAlerts:
@PhalonMar 29.2006 — [b]Q.[/b] No matter what i do Mysql won't work.

[b]A.[/b] If you have checked it with everything you find here, make sure you have access to a database on your server. Because if you don't have access you can't write anything to it. Also if your not sure about if you have access, ask your website provider, or a quicker way is if you don't know what the database is called you probably don't have access to it.
×

Success!

Help @Sheldon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...