Jump to content

how to display category results and enter with form?


xcoderx

Recommended Posts

ok i created the sql

 

create table categories (

cat_id int(10) not null primary key auto_increment,

cat_name varchar(255) not null);

 

create table subcategories (

subca_id int(10) not null primary key auto_increment,

subcat_url varchar(255) not null,

subcat_image_url varchar(255) not null,

cat_id int(10) not null);

 

now how do i make a form to enter entries into category and subcategory?

 

 

i want to display it like this

 

 

category1 name:

 

1. subcat url                  subcat image

2. subcat url                  subcat image

 

category2 name:

 

1. subcat url                  subcat image

2. subcat url                  subcat image

 

 

help out someone.

something like this?

 


<?php

error_reporting(0);
if(! $conn=mysql_connect("localhost", "root", "demo"))
die("Could't connect to database server..");
mysql_select_db("cats",$conn) or die(mysql_error());

$result = "select * from categories, subcategories where categories.cat_id = subcategories.cat_id";
echo "<table border='1'>";
while($row = mysql_fetch_array( $result )) {

 

 

but now im not sure how to go on

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.