Jump to content

mikew2

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mikew2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. lol i just realised the answer rofl. Im kicking myself. The name of my date input element was called "who" and not "date" OMFOGMGOMFOI MFOM OM ROFL OROFL LOL :p thanks for the help guys mike [b]EDITED BY WILDTEEN88: REMOVED LANGUAGE. PLEASE DO NOT SWEAR IN POSTS. THERE ARE MINORS THAT BROWSE AROUND THIS FORUM[/B]
  2. that works hacker, but its not really a solution.
  3. hmm none of that changed anything. however when i added mysql_error to the query. i got this: [quote]Line 66: MySQL Error: Incorrect date value: '' for column 'date' at row 1[/quote] I dont understand tho because the date is in the right format
  4. it means if the edit query has been started. Then display the titles.
  5. hmm im not quite sure what you mean. sorry im quite new at this. and ronald there isnt any mysql errors. Which is odd.
  6. ah thanks. But ive still got a problem. Now it says "Information has been updated" however it hasnt actually updated the row. any clues?
  7. Hi guys, Im trying to edit a row in mysql using php. This is my code: [quote]<? //connect to mysql //change user and password to your mySQL name and password mysql_connect("localhost","root","admin"); //select which database you want to edit mysql_select_db("ict"); //If cmd has not been initialized if(!isset($cmd)) {   //display all the news   $result = mysql_query("select * from contact order by id");     //run the while loop that grabs all the news scripts   while($r=mysql_fetch_array($result))   {       //grab the title and the ID of the news       $title=$r["title"];//take out the title       $id=$r["id"];//take out the id     //make the title a link       echo "<a href='edit.php?cmd=edit&id=$id'>$title - Edit</a>";       echo "<br>";     } } ?> <? if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit") {   if (!isset($_POST["submit"]))   {       $id = $_GET["id"];       $sql = "SELECT * FROM contact WHERE id=$id";       $result = mysql_query($sql);              $myrow = mysql_fetch_array($result);       ?>         <form action="edit.php" method="post">       <input type=hidden name="id" value="<?php echo $myrow["id"] ?>">         Title:<INPUT TYPE="TEXT" NAME="title" VALUE="<?php echo $myrow["title"] ?>" SIZE=30><br>       Content:<TEXTAREA NAME="message" ROWS=10 COLS=30><? echo $myrow["content"] ?></TEXTAREA><br>       Date:<INPUT TYPE="TEXT" NAME="who" VALUE="<?php echo $myrow["date"] ?>" SIZE=30><br>         <input type="hidden" name="cmd" value="edit">         <input type="submit" name="submit" value="submit">         </form>     <? } ?> <?   if ($_POST["$submit"])   {       $title = $_POST["title"];       $content = $_POST["content"];       $date = $_POST["date"];       $sql = "UPDATE contact SET title='$title',content='$content',date='$date' WHERE id=$id";       $result = mysql_query($sql);       echo "Thank you! Information updated.";   } } ?> [/quote] It works fine until i hit submit and then it just goes back to the edit.php page. And doesnt update the row. It also doesnt display the "Thank you! Information updated." However there are no mysql errors. Any help would be much appreciated Thanks Mike
  8. Hi guys, Im having trouble installing phpmyadmin onto my windows 2003 IIS 6 server. I have sucessfully installed php and mysql however when i go to the index.php page on phpmyadmin/index.php i get this error: [quote]phpMyAdmin - Error Cannot load mysql extension. Please check your PHP configuration. - Documentation [/quote] The documentation includes this: [quote]1.20] I receive the error "cannot load MySQL extension, please check PHP Configuration". To connect to a MySQL server, PHP needs a set of MySQL functions called "MySQL extension". This extension may be part of the PHP distribution (compiled-in), otherwise it needs to be loaded dynamically. Its name is probably mysql.so or php_mysql.dll. phpMyAdmin tried to load the extension but failed. Usually, the problem is solved by installing a software package called "PHP-MySQL" or something similar. [/quote] Ive uncommented the php_mysql.dll however the problem is still the same. If any has any ideas at all as to how to fix this problem it would b much appreciated. Thanks in advance Michael
×
×
  • 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.