PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 14th, 2000, 01:49 AM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned (not really)
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 1999
Location: Brussels, Belgium
Posts: 14,628 Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)Sepodati User rank is General 51st Grade (Above 100000 Reputation Level)  Folding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced FolderFolding Points: 97169 Folding Title: Advanced Folder
Time spent in forums: 3 Months 6 Days 2 h 39 m 6 sec
Reputation Power: 4375
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
Hi. I just installed SQL Server 7.0 and I'm trying to write a simple PHP script to read some data out of the sample databases.

I've fixed the php3.ini file, and that corrected the 'call to unsupported function' error I was getting.

Now, it doesn't seem to connect to the server with the mssql_connect command. Here is my code (code begins on line 8):
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?php

$link_id = mssql_connect("JOHNHOLM","user1","pass1");
//$link_id = mssql_connect('localhost','user1','pass1');

$db = mssql_select_db("Northwind",$link_id);

$query = mssql_query("SELECT * FROM Categories WHERE CategoryID = 1",$link_id);
$result = mssql_fetch_array($query);

echo "Category 1<hr>";
echo "Category Name: " . $result['CategoryName'] . "<br>";
echo "Description: " . $result['Description'] . "<br>";
echo "Picture: " . $result['Picture'] . "<br>";
echo "<hr>";

?>
[/code]
The SQL Server box says my server name is "JOHNHOLM"

I've tried various combinations of localhost and JOHNHOLM, with single and double quotes.
Here is the error I get if I just use JOHNHOLM
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
Warning: MS SQL message: ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in C:Inetpubwebpubtestdatabase.php3 on line 17

Warning: MS SQL: Query failed in C:Inetpubwebpubtestdatabase.php3 on line 17

Warning: 0 is not a MS SQL result index in C:Inetpubwebpubtestdatabase.php3 on line 18
[/code]

Here is the error I get if I just use localhost:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
Warning: 0 is not a MS SQL link index in C:Inetpubwebpubtestdatabase.php3 on line 13

Warning: 0 is not a MS SQL link index in C:Inetpubwebpubtestdatabase.php3 on line 15

Warning: 0 is not a MS SQL result index in C:Inetpubwebpubtestdatabase.php3 on line 16
[/code]

I've added a login under the SQL Server Enterprise Manager, so the problem shouldn't be with the login and username, or is it? Is there difference b/t single and double quotes ?

I've tried localhostJOHNHOLM, but that gives me the sames errors as just using localhost.

If you know anything about this, please give me some pointers. I need to do a e-commerce page for a class i'm in and the instructor is very pro ASP, but i'd like to show everyone how easier it can be done in PHP. Only this is slowing me down...

Thanks in advance...


---John Holmes
---www.SepodatiCreations.com

Reply With Quote
  #2  
Old April 14th, 2000, 04:18 AM
happy happy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 1 happy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it seems that the picture file which has type as "ntext" cause the problem.
if you use other table ie. customers , it will work

Reply With Quote
  #3  
Old April 14th, 2000, 06:14 PM
ujludwig ujludwig is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 63 ujludwig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
If John's suggestion doesn't work...

check your php.ini file... did you uncomment that mssql extension?

extension=php3_mssql.dll

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Help with connecting to mssql

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap