Skip to Content.
Sympa Menu

freetds - can create tables, can't select, insert or update

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "" <julian AT zol.co.zw>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: can create tables, can't select, insert or update
  • Date: Sat, 6 Apr 2002 00:11:59 +0200


I have finally got php-4.1.2 to talk to mssql2k on win2k through apache
1.3.22 using freetds-0.53 -- thanks for that.

I can make a table, but I can't select, insert or update. I get
"SELECT permission denied on object 'test', database 'Julian', owner
'julian'" etc.
I do have these permissions on the server.

Here's the php:

mssql_connect($hostname,$username,$password);
mssql_select_db($dbName);

// this does work:
$create_query = "create table test (
UserID int NULL ,
username varchar (20) NULL ,
password varchar (20) NULL ,
)";

// this does not work:
$insert_query = "Insert into test (UserID, username, password)
VALUES (123, 'ADMIN', 'thispassword')";

// this does not work:
$select_query = "select UserID from test";

$result = MSSQL_QUERY($select_query);

$number = MSSQL_NUM_ROWS($result);

$i=0;

if ($number == 0) :
print "No data?";
elseif ($number > 0) :
print "Data:";
while ($i < $number) :
$username = mssql_result($result,$i,"username");
print $username;
print "";
$i++;
endwhile;
endif;

-- any ideas where Ive gone wrong?

TDSDUMP and tcpdump on port 1433 record nothing when I do one of the failed
queries, but I do get records of any CREATE TABLE query.







Archive powered by MHonArc 2.6.24.

Top of Page