[PHP-DB] mssql_fetch_array not working?

2002-05-13 Thread Benjamin Walling
I apologize if the answer to this is incredibly simple. I'm trying to learn PHP, and evaluate whether to change our site away from ASP. I have the following php code, and I can't get any results. I have add the line echo mssql_num_rows($rs); to see how many rows are returned, and I get 11 (the

[PHP-DB] I'm running...

2002-05-13 Thread Benjamin Walling
It might help to tell you: Windows 2000 Server (SP2) IIS 5 PHP 4.21 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Our software

2002-05-13 Thread Benjamin Walling
I suppose it might help to know that this is on Windows 2000(SP2), IIS 5, PHP 4.21, SQL Server 2000. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mssql_fetch_array not working?

2002-05-13 Thread Benjamin Walling
uot;ItemClassKey"]; >echo ""; > } > > Gurhan > > -Original Message- > From: Benjamin Walling [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 13, 2002 5:16 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] mssql_fetch_array not working? > &g

Re: [PHP-DB] mssql_fetch_array not working?

2002-05-13 Thread Benjamin Walling
hro then could the if($rs) be moving the pointer to > the end of he result set, so there is nothing left to loop thro? > > hth > > Peter > > --- > Excellence in internet and open source software > --- > Sunmaia > www.sunmaia.

Re: [PHP-DB] mssql_fetch_array not working?

2002-05-13 Thread Benjamin Walling
I thought about that while I was copying the code from the tutorial. I know a little C++, and it seemed wrong, but I let it go. Thanks. "Terry Romine" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Do I see a semicolon at the end of the while? that won't wo

[PHP-DB] MSSQL DateTime field formatting?

2002-05-14 Thread Benjamin Walling
I can't seem to find a way to format the field that comes back from my DateTime fields in MSSQL Server. For example, '2002-05-13' shows in Query Analyzer as 2002-05-13 00:00:00.000. If I echo it from PHP, I get May 13 2002 12:00AM. date() won't take it. strftime() won't take it. What do I nee

Re: [PHP-DB] Anti-virus alarm! Sulfbnk var inget virus.

2002-05-16 Thread Benjamin Walling
It's been a long time since I heard this one. Damn marketing guy at work forwarded a similar email to the entire company, telling them to delete the file sulfnbk.exe one day when I was out. Thing was supposedly 'dormant until June 1st, 2001' and then the whole company was going to get screwed.

[PHP-DB] Re: Question about ODBC databases

2002-05-17 Thread Benjamin Walling
I don't use Access, but I believe an Access database to be just a file. You're going to have to mount (through Samba) the share on the NT server that contains the database file. There's not a server that is taking requests like an SQL server - you just open the file itself. "Gerardo Morales" <[

[PHP-DB] Re: ADODB - whaddya think?

2002-05-17 Thread Benjamin Walling
I'm starting to migrate from ASP to PHP. What are you finding that you can't to with mssql_*? I'd be interested in knowing what limitations I may be facing. "Jerome Houston" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Testimonial time! > > Despite ROCK S

Re: [PHP-DB] Re: Question about ODBC databases

2002-05-21 Thread Benjamin Walling
Write a simple web service. Put a few PHP pages on the NT server, which take parameters, and return results. For example, create a function that takes a string (sql statement, eg) as a parameter, and echos a comma delimited page (the resulting recordset). Then, on the Linux/Unix box, use the HT

[PHP-DB] Re: REGEXP for search engine/SQL Server

2002-05-21 Thread Benjamin Walling
Why not yank the quoted terms out before using split? Search for patterns ".*" and put them in a separate array. Once those are gone, split the remaining string. You may want to remove duplicate spaces created by removing the quoted terms. "Kevin Won" <[EMAIL PROTECTED]> wrote in message [EMA

[PHP-DB] Re: Complicated query on very simple database - pointers sought

2002-05-22 Thread Benjamin Walling
Look into Aggregate Functions. They can let you do the things that you are looking for. SELECT Month(OrderDate) as 'Month', Count(DISTINCT Customer) as 'NumCustomersOrdering', Count(Customer) as 'TotalOrders' FROM tbl_Orders GROUP BY Month(OrderDate) will give you a list of months, and the numb

[PHP-DB] Re: PHP Mysql Select Distinct problem

2002-05-22 Thread Benjamin Walling
MessageAccording to http://www.mysql.com/doc/D/I/DISTINCT_optimisation.html, DISTINCT is converted to a GROUP BY on all columns, DISTINCT combined with ORDER BY will in many cases also need a temporary table. Instead of using DISTINCT, consider adding GROUP BY for all the columns except ID. --

[PHP-DB] Re: Problem with JOIN

2002-05-23 Thread Benjamin Walling
I'm not sure I'm reading what you want correctly, but it sounds like you really want an INNER JOIN instead of a LEFT JOIN. INNER JOIN will only join if the records in both tables exist and match on the join criteria. Also, why are you joining the user_websites table to itself? Just use WHERE us

[PHP-DB] mssql_init using freetds

2002-08-20 Thread Benjamin Walling
I've installed freetds 0.53, php 4.2.2 and apache 1.3.26. I have some of the mssql functions working (mssql_connect(), for example). I cannot get mssql_init() to work - I get Fatal error: Call to undefined function: mssql_init() in /var/www/html/stdFunctions.php on line 128 I saw a previous pos

[PHP-DB] Re: Real Killer App!

2003-03-12 Thread Benjamin Walling
Are you doing some kind of recursion and getting stuck or overflowing the stack? If you create something like: function Factorial($x) { if ($x == 1) { return $x; } else { return $x * Factorial($x-1); } } You can get into a problem with overflowing the call stack with a sufficiently hi

[PHP-DB] Re: textarea data and printing

2003-03-13 Thread Benjamin Walling
Not really sure what you are asking. Do you want to remove the line breaks from the textarea entry? Use str_replace("\n","",$user_input); str_replace("\r","",$user_input); to remove them. If you want the user to be able to use the enter key to format the description, you will have to replace "\n