Jump to content


Lost tables!


5 replies to this topic

#1 N4Z.

    Call me Yoda

  • Members
  • PipPipPipPip
  • 3,016 posts
  • Gender:Male
  • Location:127.0.0.1
  • Interests:Designing, Apple Fan Boy, Music Production and Weekends!

Posted 11 December 2006 - 04:53 AM

Hey all,

Im in the process of making a PSD Library/Download site and my coder sent me the finished pages, but not the tables, but his host is down so we cant retrieve the tables (ceriweb.com).

Anyway, I am not what you would call a "PHP Wiz" so I was wondering whether you could see what tables i need to create just by looking at this code from my database page:

<?php
if ($auth==1) {
#Display page.
$db = mysql_connect("localhost", "$dbuser", "$dbpassword");
mysql_select_db("$database");

$loadit = mysql_query("select * from psd");
$psdlist = mysql_fetch_assoc($loadit);

$total = mysql_num_rows($loadit);

$id = $psdlist["id"];
$title = $psdlist["title"];
$owner = $psdlist["owner"];
$preview = $psdlist["preview"];

$previewurl

?>
<style type="text/css">
<!--
.red {color: #FF0000}
.white {
	color: #;
	font-weight: bold;
}
-->
</style>


<div align="center">
  <table width="566" border="0" cellspacing="0" cellpadding="0">
	<tr>
	  <td><div align="center"><br>
		  <strong>PSD Database </strong><br>
		  <br>
		  <table width="500" border="1" cellspacing="0" cellpadding="0">
			<tr bgcolor="#0066CC" class="white">
			  <td width="200" height="20"><div align="center">Title</div></td>
			  <td width="140"><div align="center">Preview</div></td>
			  <td width="75"><div align="center">Type</div></td>
			  <td width="75"><div align="center">Price</div></td>
			</tr>
			<tr>
			  <td><div align="center">
				<p><br>
				  My amazing PSD!<br>
				  <span class="red">by FabianJ<br>
				  </span></p>
				<form action="index.php?id=s_download" method="post" name="form1" target="_self">
				  <input name="id" type="hidden" id="id" value="ID $ of file">
				 
				  <input name="Submit" type="submit" value="Download">
				</form>
				</div></td>
			  <td><div align="center"><a href="SHSPCI3.jpg" target="_blank"><img src="HSPCI3.jpg" width="140" height="105" border="0"><br>
				Click to Zoom in!</a></div></td>
			  <td><div align="center">Banner</div></td>
			  <td><div align="center">Free<br>
			  </div></td>
			</tr>
		  </table>
		  <br>
		<br>
	  </div></td>
	</tr>
  </table>
</div>

<?
} else {
echo "You are not logged in!";
}
?>

I dont know if this is of any help, but if you can help, please do :blink:

Thanks.

Edited by S0LDIER., 11 December 2006 - 07:53 AM.


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 11 December 2006 - 02:40 PM

psd is the only mySQL table i see in there.

#3 N4Z.

    Call me Yoda

  • Members
  • PipPipPipPip
  • 3,016 posts
  • Gender:Male
  • Location:127.0.0.1
  • Interests:Designing, Apple Fan Boy, Music Production and Weekends!

Posted 11 December 2006 - 02:56 PM

Yeah matt said there were like 6 others.

Now the only problem is, I dont know how to make the SQL Tables now, like what to put in each, if its TEXT or whatever, im really stuck :love:

#4 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 11 December 2006 - 05:19 PM

I said 1 table with 6 fields in that table.

Matt

#5 N4Z.

    Call me Yoda

  • Members
  • PipPipPipPip
  • 3,016 posts
  • Gender:Male
  • Location:127.0.0.1
  • Interests:Designing, Apple Fan Boy, Music Production and Weekends!

Posted 11 December 2006 - 06:10 PM

What do i call the table?

#6 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 11 December 2006 - 06:42 PM

Read the code and try and understand it, just using code without knowing what it does is stupid.

$loadit = mysql_query("select * from psd");
$psdlist = mysql_fetch_assoc($loadit);

$total = mysql_num_rows($loadit);

$id = $psdlist["id"];
$title = $psdlist["title"];
$owner = $psdlist["owner"];
$preview = $psdlist["preview"];

Tells you pretty much most of the stuff you need. Reading the rest of the html display will pretty much let you know the other fields needed.

Matt

Edited by Mr. Matt, 11 December 2006 - 06:42 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users