Help
Search
Login
Register
Home
Forum: web design and graphics community
Celestial Star Forum
>
Web Development
>
Coding
>
Adding layouts to database?
Pages: [
1
]
« previous
next »
Print
Author
Topic: Adding layouts to database? (Read 2031 times)
surabhi
Angeling
Posts: 21
Adding layouts to database?
«
on:
July 14, 2005, 08:57:03 PM »
I probably sound
really
stupid but I'm confused.
I'm using this tutorial:
http://www.daydreamgraphics.com/d/tutorial/list/210/2
How do I add the layouts? Should I use the form I make to submit each layout I have? :roll: OR do I edit:
Code:
<?php
include &
#40;'connection.php');
$query
=
"select * from `layouts` where category='$category' order by id desc"
;
$result
=
mysql_query
&
#40;$query, $connection) or die
&
#40;"Could not execute query : $query." . mysql_error());
while &
#40;$row=mysql_fetch_array($result))
&
#123;
$id
=
$row
[
"id"
&
#93;;
$name
=
$row
[
"name"
&
#93;;
$artist
=
$row
[
"artist"
&
#93;;
$artisturl
=
$row
[
"artisturl"
&
#93;;
$series
=
$row
[
"series"
&
#93;;
$category
=
$row
[
"category"
&
#93;;
$previewimage
=
$row
[
"previewimage"
&
#93;;
$download
=
$row
[
"download"
&
#93;;
$viewhtml
=
$row
[
"viewhtml"
&
#93;;
echo
"<table border=\"1\" bordercolor=\"#000000\" width=\"100%\"><tr><td colspan=\"2\" align=\"center\"><strong>$name</strong></td></tr>
<tr><td><img src=\"$previewimage\"></td> <td valign=\"top\">Made by: <a href=\"$artisturl\">$artist</a><br>Series: $series<br>Category: $category</td></tR>
<tr><td colspan=\"2\" align=\"center\">| <A href=\"$viewhtml\">Preview</a> | <a href=\"$download\">Download</a> | </td></tr>
</table><br>"
;
&
#125;
?>
But I have a feeling that's not it! ^^
Logged
img]http://img.photobucket.com/albums/v495/sritri/Blends%20n%20Stuff/SIGGY.jpg[/img]
AzNPryDE15
Angeling
Posts: 2
Adding layouts to database?
«
Reply #1 on:
July 14, 2005, 09:31:09 PM »
hey you anyways i just learn how to do this to from that tutorial but on that tutorial they ask you to make that form calle addlayouts.php use that form
Logged
paine
Angeling
Posts: 7
Adding layouts to database?
«
Reply #2 on:
July 17, 2005, 07:55:01 PM »
you can load myadmin and just click on your table and near the top you can press "insert" its the same thing.
Logged
Ryan
Angeling
Posts: 20
Adding layouts to database?
«
Reply #3 on:
July 25, 2005, 08:07:54 PM »
Actually, that is only part of the script. From what I can recall, thats only the viewing script. You need a form to input the data into the database table.
Logged
url=http://moonlit-magick.net]Moonlit-Magick.net[/url]
surabhi
Angeling
Posts: 21
Adding layouts to database?
«
Reply #4 on:
July 26, 2005, 01:34:14 PM »
I know ^^. I already have the form but when I add layouts, it only shows up as |X| for the image and blank info field. 0_o
Logged
img]http://img.photobucket.com/albums/v495/sritri/Blends%20n%20Stuff/SIGGY.jpg[/img]
lulusoccer
Angeling
Posts: 19
Adding layouts to database?
«
Reply #5 on:
July 26, 2005, 04:26:04 PM »
I just set up a layout database, and my form worked just fine, try posting the code to see anybody can help you here..
Also, is your table set up correctly? You may need to change it a little.
Logged
animeallen
Retribution
Posts: 194
Adding layouts to database?
«
Reply #6 on:
July 27, 2005, 10:36:31 AM »
It took me quite a while to successfully follow the tutorial... I needed to tweak everything to make it work, show me the other parts and I'll try to see what's wrong...
Logged
img]http://img513.imageshack.us/img513/1668/yuitokyoaasignature8ma.jpg[/img]
surabhi
Angeling
Posts: 21
Adding layouts to database?
«
Reply #7 on:
July 28, 2005, 12:23:37 PM »
Ooops..Sorry!
Here's my layouts.php
Code:
<div align="center">
<?php
include &
#40;'connection.php');
$category
=
$_GET
[
'category'
&
#93;;
$query
=
"select * from `layouts` where category='$category' order by id desc"
;
$result
=
mysql_query
&
#40;$query, $connection) or die
&
#40;"Could not execute query : $query." . mysql_error());
while &
#40;$row=mysql_fetch_array($result))
&
#123;
$id
=
$row
[
"id"
&
#93;;
$name
=
$row
[
"name"
&
#93;;
$artist
=
$row
[
"artist"
&
#93;;
$artisturl
=
$row
[
"artisturl"
&
#93;;
$series
=
$row
[
"series"
&
#93;;
$category
=
$row
[
"category"
&
#93;;
$date
=
$row
[
"date"
&
#93;;
$previewimage
=
$row
[
"previewimage"
&
#93;;
$download
=
$row
[
"download"
&
#93;;
$viewhtml
=
$row
[
"viewhtml"
&
#93;;
echo
"<table border=\"1\" bordercolor=\"#000000\" width=\"22%\"><tr><td colspan=\"2\" align=\"center\"><strong>$name</strong></td></tr>
<tr><td><img src=\"$previewimage\"></td> <td valign=\"top\"><br><b>ID: $id<br><b>Name: $name<br><b>Artist: <a href=\"$artisturl\">$artist</a><br><b>Series: $series<br><b>Category: $category<br>
<b>Added: $date<br></td></tR>
<tr><td colspan=\"2\" align=\"center\">| <A href=\"$viewhtml\">Preview</a> | <a href=\"$download\">Download</a> | </td></tr> </b>
</table><br>"
;
&
#125;
?>
and addlayouts.php
Code:
<form action="submitlayout.php" method="post">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="left">Name: </td>
<td>
<input type="text" name="namedesign" size="70">
</td>
</tr>
<tr>
<td height="25" align="left">Artist: </td>
<td height="25">
<input type="text" name="artist" size="70">
</td></tr>
<tr>
<td height="25" align="left">Artist URL: </td>
<td height="25">
<input type="text" name="artisturl" size="70">
</td></tr>
<tr>
<td height="25" align="left">Series: </td>
<td height="25">
<input type="text" name="series" size="70">
</td>
</tr>
<tr>
<td height="25" align="left">Category: </td>
<td height="25">
<select name="category">
<option name="Divs" value="Divs">Divs</option>
<option name="Table" value="Table">Table</option>
<option name="PopUp" value="PopUp">PopUp</option>
<option name="IFrame" value="IFrame">IFrame</option>
</select>
</td>
<tr>
<td height="25" align="left">Thumbnail: </td>
<td height="25">
<input type="text" name="previewimage" size="70">
</td>
<tr>
<td height="25" align="left">.ZIP File: </td>
<td height="25">
<input type="text" name="download" size="70">
</td>
<tr>
<td height="25" align="left">Index.html File: </td>
<td height="25">
<input type="text" name="viewhtml" size="70">
</td>
<tr><td> </td><td><input type="submit" name="submit" value="Submit"></td></tr>
</table></form>
and submitlayouts.php:
Code:
<?php
include &
#40;'connection.php');
$q
=
"insert into layouts (id,name,artist,artisturl,series,category,previewimage,viewhtml,download) VALUES ('','$namedesign','$artist','$artisturl','$series','$category','$previewimage','$viewhtml','$download')"
;
$result
=
mysql_query
&
#40;$q,$connection);
if &
#40;$result)
&
#123;
echo
"Thank you, Layout has been added."
;
&
#125;
?>
I'm thinking in submitlayout.php,
there should be something like insert into layout and someway to add to the category given. [/b]
Logged
img]http://img.photobucket.com/albums/v495/sritri/Blends%20n%20Stuff/SIGGY.jpg[/img]
animeallen
Retribution
Posts: 194
Adding layouts to database?
«
Reply #8 on:
July 31, 2005, 03:52:01 AM »
and the database connection?
Logged
img]http://img513.imageshack.us/img513/1668/yuitokyoaasignature8ma.jpg[/img]
Melfina
Administrator
Valkyrie Randgris
Posts: 1289
Adding layouts to database?
«
Reply #9 on:
July 31, 2005, 05:11:44 AM »
She included a connection.php file where she puts the connection stuff.
Once you make that form and once it's working good, yes, you submit all information and submit everytime you want to add a layout.
I'm not sure if this is what you're asking.
Logged
MySpace
~
MySpace Codex
~
Rune Nifelheim
animeallen
Retribution
Posts: 194
Adding layouts to database?
«
Reply #10 on:
July 31, 2005, 08:42:12 AM »
I dunno but you do make some point. I just wanted to know if maybe there are some mispellings or something, but now that you've mentioned it I'm clueless... :P
Logged
img]http://img513.imageshack.us/img513/1668/yuitokyoaasignature8ma.jpg[/img]
surabhi
Angeling
Posts: 21
Adding layouts to database?
«
Reply #11 on:
August 03, 2005, 06:48:03 PM »
My connection stuff was all right..
I figured out the problem.. I had some mistakes in layouts.php and submitlayouts page.. :wink:
Logged
img]http://img.photobucket.com/albums/v495/sritri/Blends%20n%20Stuff/SIGGY.jpg[/img]
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General
=> New Members
=> Announcements
=> Support / Suggestions
-----------------------------
Contests
-----------------------------
=> Archive
===> Contests
===> Blend Challenges
===> SOTW
-----------------------------
Art Boards
-----------------------------
=> Creative mediums
=> Requests & offers
=> Tutorials
===> Celestial Star Tutorials
-----------------------------
Web Development
-----------------------------
=> Coding
=> Web Design
=> Advertisements / Affiliation
-----------------------------
Off-topic
-----------------------------
=> Entertainment
-----------------------------
Español (Spanish Only)
-----------------------------
=> General / Bienvenida
=> Anuncios / Ayuda
=> Código / Desarrollo web
Welcome,
Guest
Members login
Register for free
General
General
New members
Announcements
Support / Suggestions
Art boards
Creative mediums
Requests and offers
Tutorials
Celestial Star tutorials
Web development
Coding
Web design
Advertisements / affiliation
Off-topic
The non-sense
Ententainment
Loading...