![]() |
|
#1
|
|||
|
|||
|
A little help......? (MySQL)
I'm REALLY new to MySQL and PHP. I've gotten the basics of MySQL down, but I still can't code from stratch. >.>;
Anyways, I've been trying to organize my avatars, but it keeps on messing up. >.<; The layouts and banners are ok, but the avatars is giving me a headache........ Later, I'll be trying to organize them by series and other stuff. But for now, I'll stick with basics....... If it'll help, http://deadly-beauty.com/Avi100.php that's what it currently looks like. It's ok for two avatars, but if I put more than 4, it extends. making it unorganized. How do I fix that? |
| Sponsored Links |
|
#2
|
||||
|
||||
|
i think you would have to provide what you are doing so far to organize the items in MySQL as we dont have access to view your database itself.
__________________
phantom of the forum! mwa-ha-ha!
|
|
#3
|
|||
|
|||
|
Code:
<?php include('header.php');?>
<p class="head">100x100 Avatars</p>
<center>
<table cellspacing="5px"><tr>
<?php
$host = "localhost";
$connection = mysql_connect("mysql18.servage.net",
"",
"");
mysql_select_db("", $connection);
//This selects ALL the data from the table, 'Avi100'
$QueryName = mysql_query("select * from Avi100 ORDER BY `id` DESC LIMIT 0, 4");
//Your PHP script will stop executing if your query is wrong.
if ($QueryName != TRUE)
{
die("Query $QueryName failed.");
}
//This fetches the information from QueryName as an array.
while($row=mysql_fetch_array ($QueryName))
{
//List all of the field names of your table as an array to output.
$type=$row["type"];
$avatar=$row["avatar"];
echo "<td width='25%'><table style='margin-bottom: 0px' cellspacing='0px'><tr><td class='avihead' style='margin-bottom: 0px'>$type</td></tr><tr><td class='avi100' style='margin-top:0px;'><img src='$avatar'></td></tr></table></td>";
}
?>
</tr></table>
</center>
<?php include('footer.php');?>
I have: id type avatar for the fields. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mysql database host | Seto311 | Advanced Programming | 2 | 05-04-2006 03:14 PM |
| apache 2.0.53, mysql 4.0.22, php 5.0.3 | bejayel | User Submitted Tutorials | 2 | 07-07-2005 07:14 AM |
| MySQL configs... | agent_x | Advanced Programming | 1 | 12-15-2004 02:29 AM |
| Installing Apache, PHP, and MySQL on Windows | sebluver | User Submitted Tutorials | 1 | 02-29-2004 09:22 PM |
| Getting mysql working | DisturbedOne | User Submitted Tutorials | 0 | 12-10-2003 09:41 PM |