Jump to content

pls help on smart part of codnig


yeakyau

Recommended Posts

<?php

 

// load the configuration file.

 

include("config.php");

 

        //load all news from the database and then OREDER them by newsid

 

        //you will notice that newlly added news will appeare first.

 

        //also you can OREDER by (dtime) instaed of (news id)

 

        $result = mysql_query("SELECT * FROM news ORDER BY newsid DESC",$connect);

 

        //lets make a loop and get all news from the database

 

        while($myrow = mysql_fetch_assoc($result))

 

            {//begin of loop

 

              //now print the results:

 

              echo "<b>Title: ";

 

              echo $myrow['title'];

 

              echo "</b><br>On: <i>";

 

              echo $myrow['dtime'];

 

              echo "</i><hr align=left width=160>";

 

              echo $myrow['text1'];

 

              // Now print the options to (Read,Edit & Delete the news)

 

              echo "<br><a href=\"read_more.php?newsid=$myrow[newsid]\">Read More...</a>

 

                || <a href=\"edit_news.php?newsid=$myrow[newsid]\">Edit</a>

 

                || <a href=\"delete_news.php?newsid=$myrow[newsid]\">Delete</a><br><hr>";

 

            }//end of loop

 

?>

 

After i remove echo "<br><a href=\"read_more.php?newsid=$myrow[newsid]\">Read More...</a>

 

                || <a href=\"edit_news.php?newsid=$myrow[newsid]\">Edit</a>

 

                || <a href=\"delete_news.php?newsid=$myrow[newsid]\">Delete</a><br><hr>";

 

            }//end of loop

 

the edit and delete part it become error may i knw is there any method to remove it wihout showing that 2

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.