Hi all, i am trying to insert some data into a table via a php function as below function save_link($new_link) { echo 'new link = '.$new_link; #just to make sure the code gets to here if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } else { echo 'success! were in!'; } $query = "INSERT INTO college_values (link_code, year_2011, year_2012, year_2013, year_2014) VALUES ('AAAB',0,0,0,0)"; $retval = mysql_query($query, $dbc); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } return $result; } but i get the following message - Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in.... I have tried many different combinations of $query but the one above does work if I paste it into the query section of PHPMyAdmin.I can substitute the query for a SELECT and it works fine. I just cant see why the INSERT doest work.
Many thanks.