| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) | ||||
| Account Suspended Join Date: Jun 2006
Posts: 472
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | |
| Quote: |
| Total Templates: 31 Total Downloads: 18 Total Tutorials: 17 Users Online: 1 user online |
| | #2 (permalink) |
| Tech Support Join Date: Mar 2005
Posts: 4,944
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Yes, would be fairly easy. Would need to know your database structure to give you the exact code for it... But, let's say your template table was for example: Code: CREATE TABLE templates ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, title VARCHAR(255) NOT NULL, author VARCHAR(255) NOT NULL, PRIMARY KEY (id) ); ????: NamePros.com http://www.namepros.com/showthread.php?t=278437 PHP Code: |
| |
| | THREAD STARTER #3 (permalink) |
| Account Suspended Join Date: Jun 2006
Posts: 472
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Thanks for the code, really appreciate it ![]() When I enterted the code I got this error PHP Code: |
| |
| | #5 (permalink) | ||||
| NamePros Regular Join Date: Jun 2006 Location: Sydney
Posts: 251
![]() ![]() |
Those errors are saying your trying to connect to the database with out a password, i would suggestion you check the mysql_connect/ mysql_pconnection function to make sure there's a password in there, and if your storing the password in a varible, that the varible is spelt the same in all places (it's a common problem even out experinced dev team at work suffer from .. =) )
__________________ Site Armory, tools for your website | Webmaster SEO Forums | PHP Tutorial and coding forums | ||||
| |
| | #6 (permalink) |
| NamePros Regular Join Date: Jul 2006 Location: England
Posts: 721
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | At this to the top if you do not have a config page, <? $dbhost = "localhost"; // database host, most of the time localhost $dbuser = "username"; // database user $dbpass = "pass"; // database password $dbname = "dbname"; // database name // DO NOT EDIT mysql_connect("$dbhost","$dbuser","$dbpass"); mysql_select_db("$dbname"); ?> That will connect for you, else do an include once with your php config file |
| |