Jump to content

jasonborne

Members
  • Posts

    3
  • Joined

  • Last visited

jasonborne's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks for the replies. I have a new problem.. I may be dumb but I was getting an error "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in" in my script. Couldnt figure it out so naturally I started to search for answers. I checked 2 other peoples scripts ran them and I get the same error in their scripts now. Could I have screwed something up in mysql or phpmyadmin that is causing this? Sample: $title=$_POST['title'] ; $author= $_POST['author'] ; $name=$_POST['name'] ; $copy=$_POST['copy'] ; mysql_query("INSERT INTO `books`(Title,Author,PublisherName,CopyrightYear) VALUES ('$title','$author','$name','$copy')"); }?></form><table border="1"> <?php include("db.php"); $result=mysql_query("SELECT * FROM books"); while($test = mysql_fetch_array($result)) <<<<----------ERROR-------------------- { $id = $test['BookID']; echo "<tr align='center'>"; echo"<td><font color='black'>" .$test['BookID']."</font></td>"; echo"<td><font color='black'>" .$test['Title']."</font></td>"; echo"<td><font color='black'>". $test['Author']. "</font></td>"; echo"<td><font color='black'>". $test['PublisherName']. "</font></td>"; echo"<td><font color='black'>". $test['CopyrightYear']. "</font></td>"; echo"<td> <a href ='view.php?BookID=$id'>Edit</a>"; echo"<td> <a href ='del.php?BookID=$id'><center>Delete</center></a>"; echo "</tr>"; } mysql_close($conn); ?>
  2. Sorry guys I really need help. Have been staring and trying everything tio correct a (probably) obvious error here! My Update query wont fire. Results returned are exactly as strated out. I fear I may be missing the obvious because I have been trying for hours to see where I have gone wrong. The Form works and returns the correct data from the db. I make my changes to update and nothing happens, not even an error! //Sanitize the POST values $adposition = clean($_POST['adposition']); $advertarea = clean($_POST['advertarea']); $adclient = clean($_POST['adclient']); $advertdate = clean($_POST['advertdate']); $advertrate = clean($_POST['advertrate']); $advert = clean($_POST['advert']); $advertstatus = clean($_POST['advertstatus']); //Create update query $sql = "UPDATE vancancies SET adposition='$adposition', advertarea='$advertarea', adclient='$adclient', advertdate='$advertdate', advertrate='$advertrate', advert='$advert', advertstatus='$advertstatus' WHERE advertID='$id'"; $result = @mysql_query($sql);
×
×
  • Create New...