What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Help

PHP Help
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: PHP Help
connection.inc.php
code:
<?php
function opendb(){
    mysql_connect("localhost", "username", "password") or die("Can't Connect to database, try again later");
    mysql_select_db("database");
}
?>


index.php
code:
<?
include("connection.inc.php");
opendb();

$sql = "INSERT INTO `table` (`id`, `name`) VALUES ('".$id."', '".$name."')";
mysql_query($sql) or die (mysql_error());
?>

That's how I always do it with my websites.

EDIT: Added the mysql_query bit.

This post was edited on 11-21-2005 at 08:02 AM by Ezra.
[Image: 1-0.png]
             
11-21-2005 07:49 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Help - by DragonX on 11-21-2005 at 05:41 AM
RE: PHP Help - by ipab on 11-21-2005 at 06:57 AM
RE: PHP Help - by Ezra on 11-21-2005 at 07:49 AM
RE: PHP Help - by J-Thread on 11-21-2005 at 09:15 AM
RE: PHP Help - by DragonX on 11-21-2005 at 09:15 AM
RE: PHP Help - by ipab on 11-21-2005 at 04:37 PM
RE: PHP Help - by J-Thread on 11-21-2005 at 05:29 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On