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

PHP Help
Author: Message:
DragonX
Full Member
***

Avatar

Posts: 226
Reputation: 10
40 / Male / –
Joined: Aug 2005
O.P. PHP Help
Alright, i'm making my own site in wish i use php/mysql so therefore i need to make a connection. Since my connection details changes from my pc to my host i though of making a conn.php file to include in my other files which i could change. It looks something like this...

conn.php
code:
<?php
  $conn = mysql_connect("localhost", "user", "pass") or die ("Problem connecting to Database");
  mysql_select_db("dbname", $conn);

  .....
?>

other.php
code:
<?php
  include (conn.php);

  .....
?>

but when i do:
code:
$query_string = "select * from table";
$result = mysql_query($query_string, $conn);
it gives an error that $conn isn't declared. So i was just looking for some insight, or if there's a better way of doing it.

Thx in advance :)
[Image: dsd-mi_616175.png]
11-21-2005 05:41 AM
Profile E-Mail 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