bwcc Posted August 30, 2007 Share Posted August 30, 2007 I've been working on a front-end to a database for a while now. There are 2 databases - dou_staff and mso. In the mso dbase, I recently created a new table called mso_tasks. I've used SELECT statements on that dbase w/o problems so far. A new page reads: <? $id=$_GET['id']; $server="********"; $username="*********"; $password="**********"; $sqlconnect=mssql_connect($server, $username, $password); $sqldb=mssql_select_db("mso",$sqlconnect); if (isset($_POST['submit'])) { mssql_query("INSERT INTO mso_tasks ('step_id', 'cdate', 'sdate', 'ddate', 'email', 'complete') VALUES ('{$_POST['step_id']}', '{$_POST['cdate']}', '{$_POST['sdate']}', '{$_POST['ddate']}', '{$_POST['email']}', '{$_POST['complete']}')"); }else{ $row=mssql_fetch_array(mssql_query("SELECT * FROM mso_steps WHERE id='".$id."'")); mssql_select_db("dou_staff",$sqlconnect); $rowstaff=mssql_fetch_array(mssql_query("SELECT * FROM staff WHERE id='".$row['staff_id']."'")); ?> ....more code..... The UPDATE statement is yielding the Invalid object name Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'mso_tasks'. (severity 16) in task_assign.php on line 7 If I put a simple SELECT statement before the UPDATE statement, the SELECT statement runs fine and returns the query result. I checked the permissions for the username and it's the same for all of the other tables as well. I have also tried using <database>.<user>.<table> format, with the same result. This is perplexing me - any insight would be appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/67311-stuck-on-an-invalid-object-name-error/ Share on other sites More sharing options...
bwcc Posted August 30, 2007 Author Share Posted August 30, 2007 Update - The insert command in Query Analyser also gives the same error. But an Update command works just fine. Quote Link to comment https://forums.phpfreaks.com/topic/67311-stuck-on-an-invalid-object-name-error/#findComment-337732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.