Jump to content

Stuck on an Invalid object name error


bwcc

Recommended Posts

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!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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