Jump to content


Photo

approval comments


  • Please log in to reply
3 replies to this topic

#1 OLM3CA

OLM3CA
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationCyprus

Posted 12 September 2006 - 08:36 PM

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.

create table Catagories
cat_id  (key)
catagory_name


create table Links
link_id (key)
cat_id
link_title
link_url
link_desc

I am sorry for my english.
AMD rather than Intel , PHP rahter than ASP

#2 gijew

gijew
  • Members
  • PipPipPip
  • Advanced Member
  • 240 posts
  • LocationCalifornia

Posted 12 September 2006 - 11:08 PM

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.

<?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
  }
}
?>

I'm considered good looking in some countries

#3 OLM3CA

OLM3CA
  • Members
  • PipPipPip
  • Advanced Member
  • 52 posts
  • LocationCyprus

Posted 13 September 2006 - 01:58 AM

Thank you very much gijew;This is out of question but if I have 30,40 mysql queries is it normal ? :)
AMD rather than Intel , PHP rahter than ASP

#4 Wintergreen

Wintergreen
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 13 September 2006 - 02:01 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users