View Full Version : A little help......? (MySQL)


Yokura
10-20-2006, 12:51 AM
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?

pb&j
10-20-2006, 01:57 PM
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.

Yokura
10-20-2006, 11:13 PM
<?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');?>


you mean that?
I have:

id
type
avatar

for the fields.