teongkia Posted November 28, 2006 Share Posted November 28, 2006 May i know how to delete the specific row of data and write a new one in MySQL database table using php code?Thanks a lot.. Link to comment https://forums.phpfreaks.com/topic/28697-database-help/ Share on other sites More sharing options...
fert Posted November 28, 2006 Share Posted November 28, 2006 [code]ALTER TABLE `table` DROP * WHERE `value`='value'[/code] Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131334 Share on other sites More sharing options...
trq Posted November 28, 2006 Share Posted November 28, 2006 Read [url=http://hudzilla.org/phpwiki/index.php?title=Databases]this[/url]. This is just one of MANY tutorials, why do you need us to write another? Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131337 Share on other sites More sharing options...
jsladek Posted November 28, 2006 Share Posted November 28, 2006 Nice tutorial thorpe, I'll have to read that thing... Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131338 Share on other sites More sharing options...
teongkia Posted November 28, 2006 Author Share Posted November 28, 2006 <?phpmysql_connect("localhost","root","")or die(mysql_error());mysql_select_db("pnecnew")or die(mysql_error());$result = mysql_query("UPDATE example1 SET name='<a href="a1.php">a1</a>' WHERE id='1'") or die(mysql_error()); $result = mysql_query("SELECT * FROM example1 WHERE id='1'") or die(mysql_error()); // get the first (and hopefully only) entry from the result$row = mysql_fetch_array( $result );echo $row['name']." - ".$row['age']. "<br />";?>I want to rename the column name which holds id='1'.Can anyone let me know why it doesn't work?Thanks. Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131357 Share on other sites More sharing options...
teongkia Posted November 28, 2006 Author Share Posted November 28, 2006 error in line 5. Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131358 Share on other sites More sharing options...
trq Posted November 28, 2006 Share Posted November 28, 2006 [code=php:0]$result = mysql_query("UPDATE example1 SET name='<a href=\"a1.php\">a1</a>' WHERE id='1'")or die(mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131362 Share on other sites More sharing options...
teongkia Posted November 28, 2006 Author Share Posted November 28, 2006 Oh Thanks guru.Much appreciated ;D Link to comment https://forums.phpfreaks.com/topic/28697-database-help/#findComment-131374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.