Whould anyone have any idea why this is not inserting anything to my database? I am positive the database connection is correct. here is my code.
==========================
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("SLIP",$db);
if (list($key, $val) = each($result))
{
$query .= "mysql_query(\"INSERT INTO user_competencies (com_ID, score) VALUES ($key, $val)\",$db); ";
}
?>
==============================
when I echo $query I get:
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (81, 0)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (82, 1)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (83, 2)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (84, 3)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (85, 4)",Resource id #1);
=============================
Is there something I am not doing?
Any help would be greately appreciated !
Thanks in advance!
=================================
Imagination is more important than knowledge.
(A.E.)
==========================
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("SLIP",$db);
if (list($key, $val) = each($result))
{
$query .= "mysql_query(\"INSERT INTO user_competencies (com_ID, score) VALUES ($key, $val)\",$db); ";
}
?>
==============================
when I echo $query I get:
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (81, 0)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (82, 1)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (83, 2)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (84, 3)",Resource id #1);
mysql_query("INSERT INTO user_competencies (com_ID, score) VALUES (85, 4)",Resource id #1);
=============================
Is there something I am not doing?
Any help would be greately appreciated !
Thanks in advance!
=================================
Imagination is more important than knowledge.
(A.E.)