Graphic Design Forum and Web Design Forum  

Go Back   Graphic Design Forum and Web Design Forum »Web Design Forum »Programming Forum

Notices

Programming Forum Web and Software Programming Forum - Java, PHP, SQL etc.


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 04-02-2008, 08:07 PM
jwade_m's Avatar
Graphic/Web Designer
 
Join Date: Aug 2007
Location: Indiana, United States
Posts: 196
Default

How can I do this in Dreamweaver? (turn on error reporting)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #12 (permalink)  
Old 04-02-2008, 10:54 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

lol, you don't.
You edit the php.ini file on the server.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #13 (permalink)  
Old 11-02-2008, 05:18 PM
jwade_m's Avatar
Graphic/Web Designer
 
Join Date: Aug 2007
Location: Indiana, United States
Posts: 196
Default

Ok. Slightly different question now. Look below at the two sets of code. These are from two different connection files. They are coded differently, but will both work?

first set

$server = "mysql.hostname.com"; // this is the server address and port
$username = "fakeuser"; // change this to your jimmy username
$password = "passnotreal"; // change this to your jimmy password
$dbname = "databasename";

//User u70353840 with password 'f78c8' added to d60324644.
$link = mysql_connect ($server, $username, $password,$dbname)
or die ("Could not connect");
if (!@mysql_select_db("databasename", $link)) { // leave the database name as anydb for now
echo "

There has been an error. This is the error message:

";
echo "

" . mysql_error() . "

";
echo "Please Contant Your Systems Administrator with the details";
}


?>



second set
function connect_db()
{
$DBhost = "mysql.hosthost.com";//change
$DBuser = "fakename";//change
$DBpass = "fakepassword";//change
$DBName = "nameofdatabase";//change
$conn = mysql_connect($DBhost , $DBuser, $DBpass,$DBName)
or die("There was a problem connecting to MySQL. Please try again later.");

if (!@mysql_select_db("nameofdatabase", $conn))//change
{
die ("There was a problem connecting to the database. Please try again later.");
}
return $conn;
}

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #14 (permalink)  
Old 11-02-2008, 08:20 PM
tommylogic's Avatar
Markup Validation Nazi
 
Join Date: Apr 2007
Location: USA
Posts: 3,538
Default

explain exactly what it is you are trying to connect.. ie: MovableType, WordPress, Joomla!, etc. And are you trying to do this on a local machine or a live database on the web?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #15 (permalink)  
Old 11-02-2008, 08:27 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

The first one is the more usual way of doing it, but the second will work if connect_db() is called. Since $conn isn't global, you need to type something like

PHP Code:
$foo connect_db(); 
not 100% on that.
$foo will be your link after that. It's not a bad way of doing it if you plan on re-using the code lots.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #16 (permalink)  
Old 11-02-2008, 08:39 PM
tommylogic's Avatar
Markup Validation Nazi
 
Join Date: Apr 2007
Location: USA
Posts: 3,538
Default

I see from your other posts that you are trying to connect Dreamweaver to a local database on your machine... you might take a look into this...

Video Tutorial | Testing Server & Dreamweaver
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #17 (permalink)  
Old 13-02-2008, 03:00 AM
jwade_m's Avatar
Graphic/Web Designer
 
Join Date: Aug 2007
Location: Indiana, United States
Posts: 196
Default

thanks guys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #18 (permalink)  
Old 13-02-2008, 05:34 PM
tommylogic's Avatar
Markup Validation Nazi
 
Join Date: Apr 2007
Location: USA
Posts: 3,538
Default

hope that solved your problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #19 (permalink)  
Old 13-02-2008, 05:54 PM
LeadMagnet's Avatar
Mr. Tambourine Man
 
Join Date: Jun 2007
Location: Ireland
Posts: 1,081
Default

push teh buttons and teh internets works
__________________
Subtlety is my middle name... and first and last in case you didn't get the point.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
  #20 (permalink)  
Old 12-03-2008, 06:30 PM
jontywagener's Avatar
Experienced Member
 
Join Date: Oct 2007
Location: South Africa
Posts: 124
Default

heres my two cents:
i quite like this kind of mysql connection script, i spose u could use it for postgresql without too much difficulty.


// add your information here.
define(HOST, 'localhost');
define(USER, 'yourusername');
define(PASS, 'yourpassword');
define(BASE, 'yourdatabase');

/// --- you would not really need to edit below here --- ///
// add some connection error handling so that we get a nice error.

// check the connection string.
if(!@mysql_connect(HOST, USER, PASS)) {
echo "Database could not be connected to. Please check your settings";
}

// then we check the selection string.
if(!@mysql_select_db(BASE)) {
echo "The database selection could not be completed. Please check your settings.";
}

?>

im probably a little late but anyway :)
__________________
its just me :)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!RSS Share on Facebook Share This Article & VoteForum Netvibes Page
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
WordPress Database has Come Back! Graphic Design Blog Graphic Design Blog 0 05-05-2008 03:00 AM
ISBN Database Solution swtectonics Graphic Design and Web Design Help 3 05-03-2008 02:21 PM
database question jwade_m Programming Forum 10 17-01-2008 12:13 PM
Database Toon Graphic Design Forum Announcements 12 07-01-2008 03:43 PM
Computerlove™ - Connecting Creative Talents Graphic Design Links Graphic Design Links 0 30-10-2007 01:20 AM


All times are GMT. The time now is 06:37 AM.



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC5