View Full Version : PHP Help please
Flisker
19-10-2005, 05:31 PM
Hey Guys :D i am trying to learn php right and i need help i want to make a simple project to view a Database by Puting in the database details in a file and then you can veiw it on another page and i have this atm on the viewing page:
$include = 'the database file name';
so what do i put next please help
thanks DJ-Snoop
tleftye
19-10-2005, 05:44 PM
Argh can't help you , I have some problem when I'm making login system , he ask the same but I think you need to log on onto cpanel then go to database and the name you see.. :p most of the time it's:
YOURUSERNAME_ANDSOMTHINGELSE
Flisker
19-10-2005, 05:51 PM
i know that but i am making a little project to view a Database and see what
something you installed has put in the database and if i manage to make this project i will make it biger :D and show it on this forum :D
Mentor
19-10-2005, 05:52 PM
well id gues u want to make a mysql DB connection, just use this
$dbh = mysql_connect ("localhost","DATA BASE USER", "DATA BASE PASS") or die ('DATABASE ERROR due to: ' . mysql_error());
mysql_select_db ("DATABASE WANTING TO USE");
tleftye
19-10-2005, 05:56 PM
Yea that's code to connect indeed but snoop will you tell us abit more cause we don't really know what you really want
Flisker
19-10-2005, 05:59 PM
Well what i want is a script to view the Database i have the connections page but i need the script for the main page to view the database (YAY my 100th Post)
Mentor
19-10-2005, 06:09 PM
View the database? u want to run a quiry on the db and exstract some of the info? or loop out a whole table? or what, im kinda confused "/ if u just wana view the database just use phpmyadmin
Flisker
19-10-2005, 06:11 PM
its a project i want to do i want to view every bit of file inside the database by using PHP and i am stuck and i need help how to make it view a Database
Mentor
19-10-2005, 06:22 PM
just open every table, the loop of all the results for each would be easyest way, seems pretty pointless thogh
Flisker
19-10-2005, 06:24 PM
you've confused me all i need is a simplae PHP code
tleftye
19-10-2005, 06:30 PM
ask around on talanted php sites.. I think they are much better in this then we
Flisker
19-10-2005, 06:38 PM
Yea but i thought there was really talented PHP scripters so i thought here was the best place
splintercell!
20-10-2005, 06:48 AM
do you mean..
$db = mysql_query("SELECT * FROM dbname");
$row = mysql_fetch_array($db);
so to display it you would use:
$row['name']; replace name with the names of your colum headers..
thats the mos basic way to just extract all the info.
Flisker
20-10-2005, 08:20 AM
i think so thank you Splinter ;)
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.