Jump to content

kurbitur

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

kurbitur's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hihi, I´m a newbie in mysql so (ha-ha on me) I was struggling to 3 am last night making a simple editNews (update record) I copy/paste another code I´ve been using on another engine and changed the db info but nothing worked - I realized this morning the problem must be the update privilege on the table Does anyone knows how I change that in phpmyadmin? (don´t have time to google anymore for hours - must continue with this project)
  2. Hi thanx for the answer I´ll have the "latest from most of the catgories" but on the top are BREAKING NEWS and sometime if from "entertainment" is interesting I maybe want to make it "feature"
  3. I´m making a news webpage with many categories like "Business", "local", "world", "sports", "Health", "travel" and so on.... I think the best way is that each cat. has it´s own table and in the CMS I can check (box) "make this article appear on frontpage" So the breaking news and most recent news on frontpage are talking records from all the 10 tables but only the one who are marked as "frontpage" how would the code be? like ("SELECT FROM 'news', 'business', 'local', 'world', 'sports', 'health', 'travel' IF COLUMN publish CONTAINS WORD 'frontpage'"); ... trying to figure it out - any suggestions?
  4. I have a small (42 hours) problem with my code trying to edit article (edit.php) ... should be basic When I choose article to edit the data appears in the forms and when hit "update" it returns no error, but the date didn´t changes in the db less talk - more code .... anyone who can spot what I am doing wrong? <?PHP connection to database blah blah ?> <?php if(isset($_POST['update'])) { //here the id that we post is the same id that we get from url //id indicates the id of this data which we are editing //id is unique and a particular id is associated with particular data $newsid = $_POST['newsid']; $date=$_POST['date']; $time=$_POST['time']; $location=$_POST['location']; //updating the table $result=mysql_query("UPDATE news SET date='$date',time='$time',location='$location', WHERE newsid=$newsid"); //redirectig to the display page. In our case, it is index.php header("Location: listNews.php"); } } ?> <?php //for displaying data of this particular data //getting id from url $newsid = $_GET['newsid']; //selecting data associated with this particular id $result=mysql_query("select * from news where newsid=$newsid"); while($res=mysql_fetch_array($result)) { $date = $res['date']; $time = $res['time']; $location = $res['location']; } ?> ---- form ---- <form method="post" action="editNews.php" name="form1"> each form has <input type="text" name="headline" value="<?php echo $location;?>" id="UserName"> and <input type="hidden" name="newsid" value=<?php echo $_GET['newsid'];?> <input name="update" type="submit" value="update" /> Most likely there is something that I don´t see but "seeing" has taken almost 2 days now
×
×
  • 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.