OLM3CA Posted September 12, 2006 Share Posted September 12, 2006 hi i would like to ask a question.I have a link submit form. Firstly I want to see the submitted links and than if its ok,I want to approve it and let it display in homepage.I mean the posted links can not be displayed,if I dont approve it.How can I do this ? i have some thought some ways but confused.Store them in a table like temp table and then transfer them to my real table ? and I have another question.I want to show the catagories (no problem with this) and then show the links that is related with that catagorie.Is this correct ??? How can I jump from catagories to Links table.[color=red]create table Catagories[/color][color=green]cat_id (key)catagory_name[/color][color=red]create table Links[/color]link_id (key)[color=red]cat_id[/color]link_titlelink_urllink_descI am sorry for my english. Quote Link to comment Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 This should be a fairly simple fix for ya = )Add a new field to the links table that has `status` with a default of 0. When someone submits a new link it will automatically take on the status of 0. When you authorize the link, it can update the field to 1. When you query your links, just show only the links that are equal to 1.As for the categories -> links question, do something like this.[code]<?php$sqlCategories = mysql_query("SELECT cat_id, category_name FROM categories ORDER BY category_name ASC") or die (mysql_error());while ($Category = mysql_fetch_array($sqlCategories)) { $sqlLinks = mysql_query("SELECT link_id, cat_id, link_title, link_url, link_desc FROM links WHERE cat_id = $Category[cat_id] AND status = 1 ORDER BY link_title ASC") or die (mysql_error()); // You can output your categories here while ($Links = mysql_fetch_array ($sqlLinks)) { // output your links here }}?>[/code] Quote Link to comment Share on other sites More sharing options...
OLM3CA Posted September 13, 2006 Author Share Posted September 13, 2006 Thank you very much gijew;This is out of question but if I have 30,40 mysql queries is it normal ? :) Quote Link to comment Share on other sites More sharing options...
Wintergreen Posted September 13, 2006 Share Posted September 13, 2006 Don't apologize for your English, your question was quite a bit clearer than many of the native speakers I've seen post on here Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.