Unable to update mysql with php code. (code attached)
Posted: Sun Apr 22, 2007 11:41 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
UAH is my database, yahoo is a table with id and name as fields. I got some code off of another site and it works but I'm trying to use the method our instructor taught and I'm having trouble. Any help is greatly appreciated.Code: Select all
<?
$name = "Kim";
$id = "44";
$conn=mysql_connect("127.0.0.1", "odbc", "");
mysql_select_db("uah",$conn);
$sql = "Insert into yahoo values('$id', '$name')";
mysql_query($sql,$conn);
$result = mysql_query($sql,$conn);
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]