Jump to content

Database help..


teongkia

Recommended Posts

<?php
mysql_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

Archived

This topic is now archived and is closed to further replies.

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