#1
|
||
|
fetch maps from phpMapDb
I am re-doing my site / front page mostly, and I was wondering if there is a way to fetch the latest 5 maps submitted to the php mapdb, to the front page, their names and download id should be more than ennough.
Could you scott, or someone else please help me with this? |
#2
|
||
|
yeah now i'm not sure what the set up is but here is how it will sort of go ...
[code:1:ffb6db778e] <? //Connect To DB $connect = ("mysql_host","mysql_username" ,"mysql_password") or die("Map Data Base Currently Offline!"); //chose database mysql_select_db("whateverdb","$conn ect") or die("Map Data Base Currently Offline!"); //Query The mysql_db $query = mysql_query("SELECT * FROM tablename ORDER BY id_name DESC LIMIT 10"); //fetch data in array while($myrow=mysql_fetch_array($query)){ echo" bla bla bla <a href=\"$myrow[map_download_link]\">$m yrow[map_name]</a> bla bla "; } exit; ?>[/code:1:ffb6db778e] Now if i owned the script i could actually give out names , and what not bu it don't so hopefuly you can edit it to do what you like. |
#3
|
||
|
Thanks alot, I got a few errors, but after some tweaking I got rid of them.
But there's one I can't seem to work out: " Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/varg/public_html/index9.php on line 130" the code im using: [code:1:f584782ce0]<? //Connect To DB $dbh=mysql_connect (localhost, myusername, mypass) or die("Map Data Base Currently Offline!"); //chose database mysql_select_db(varg_mapdb,$dbh) or die("Map Data Base Currently Offline!"); //Query The mysql_db $query = mysql_query("SELECT * FROM phmapdb_maps LIMIT 10 ORDER BY mid DESC"); //fetch data in array while($myrow = mysql_fetch_array($query)){ echo"<a href=\"$myrow[map_download_link]\">$m yrow[map_name]</a>"; } exit; ?> //(line 130 : while($myrow = mysql_fetch_array($query)){ ) [/code:1:f584782ce0] Any ideas? |
#4
|
||
|
it means your not pulling out something that's there, in other words what your trying to pull out is not there, make it case sensitive, and be sure to make sure names and all are good .... if i owned the script i could help out a lil better lol .
|
#5
|
||
|
yo scott, can you help out here?
what should this line be?? [color=darkred:f42d4caa98]$query = mysql_query("SELECT * FROM [/color:f42d4caa98][color=red:f42d4caa98] phmapdb_maps[/color:f42d4caa98][color=darkred:f42d4caa98] LIMIT 10 ORDER BY [/color:f42d4caa98][color=red:f42d4caa98]mid [/color:f42d4caa98][color=darkred:f42d4caa98]DESC");[/color:f42d4caa98] This is the last thing I need to have my site as I want it.. (http://mapmakersheaven.com) //EDIT: haha I figured it out myself, and it works great. here's the line, in case someone else needs it: [color=darkred:f42d4caa98]$query = mysql_query("SELECT mid,mname FROM phmapdb_maps ORDER BY mid DESC LIMIT 5");[/color:f42d4caa98] |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Coverting npj maps 2 mis maps | the teacher | Joint Operations | 0 | 05-31-2007 10:13 PM |
permission to add maps to our maps db | SSBUILD | General Chat | 2 | 03-14-2005 04:51 PM |
Link counter + phpMapdb | varg | phphq.Net Forums | 0 | 10-28-2004 06:41 PM |
Incorporating TFD DM,SD, KOTH maps into TDM maps | tc.iyaayas | Delta Force | 6 | 12-14-2002 09:26 AM |
20 New DF:LW Maps, DF:TFD maps tomorrow! | Scott | News | 0 | 07-01-2002 11:39 AM |