php-general Digest 6 Sep 2012 10:48:00 -0000 Issue 7953

Topics (messages 318996 through 319001):

Re: MS SQL server connection problem.
        318996 by: Serge Fonville
        318997 by: Jeff Burcher
        318998 by: Girish Talluru
        319000 by: Andrew Ballard

Re: templeting
        318999 by: Mihamina Rakotomandimby

use JSON storage on RAMdisk instead of SQL? (for fast moving sites)
        319001 by: rene7705

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi,

why do I need a native client or ODBC driver when I already got this driver
> installed in my system.


You need the Native Client on top of the PHP driver.
The PHP driver implements functions that enable PHP to talk  to SQL Server
through  the Native Client.

HTH

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table



2012/9/5 Girish Talluru <girish.dev1...@gmail.com>

> Hi All,
>
> I'm having problem while connecting to MS SQL server from my php program.
>
> I tried downloading driver from Microsoft and changed php.ini file but it
> is showing the following error.
>
> This statement I used to connect.
> $connect = mssql_connect("localhost", "PC6", "password");
>
> This is the error message I got
> Call to undefined function mssql_connect() in C:\wamp\www\Test\dbTest.php
>
> Then I tried other one as shown below:
>
>
> This statement I used to connect.
> $connect = sqlsrv_connect("localhost", "PC6", "password");
>
> This is the error message I got
> Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code]
> => -49 [2] => This extension requires the Microsoft SQL Server 2012 Native
> Client. Access the following URL to download the Microsoft SQL Server 2012
> Native Client ODBC driver for x86:
> http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension
> requires the Microsoft SQL Server 2012 Native Client. Access the following
> URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for
> x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] =>
> IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC
> Driver Manager] Data source name not found and no default driver specified
> [message] => [Microsoft][ODBC Driver Manager] Data source name not found
> and no default driver specified ) )
>
> It is asking to download a native client. but i have already downloaded a
> driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098
> named SQLSRV30.EXE
>
> why do I need a native client or ODBC driver when I already got this driver
> installed in my system.
>
> Please help me out with this guys. I'm new to this.
>
> Thanks,
> Girish Talluru
>

--- End Message ---
--- Begin Message ---
Hi,

I am relatively new as well. I tried both of those methods with no luck. I
finally had success using odbc_connect(). See below:

$conn = odbc_connect("Driver={SQL
Server};Server=$server;Database=$database;", $user, $password);

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com

> -----Original Message-----
> From: Girish Talluru [mailto:girish.dev1...@gmail.com]
> Sent: Wednesday, September 05, 2012 5:57 AM
> To: php-gene...@lists.php.net
> Cc: rahu...@radiare.co.in
> Subject: [PHP] MS SQL server connection problem.
> 
> Hi All,
> 
> I'm having problem while connecting to MS SQL server from my php
> program.
> 
> I tried downloading driver from Microsoft and changed php.ini file but it
is
> showing the following error.
> 
> This statement I used to connect.
> $connect = mssql_connect("localhost", "PC6", "password");
> 
> This is the error message I got
> Call to undefined function mssql_connect() in
> C:\wamp\www\Test\dbTest.php
> 
> Then I tried other one as shown below:
> 
> 
> This statement I used to connect.
> $connect = sqlsrv_connect("localhost", "PC6", "password");
> 
> This is the error message I got
> Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code]
=> -
> 49 [2] => This extension requires the Microsoft SQL Server 2012 Native
Client.
> Access the following URL to download the Microsoft SQL Server 2012 Native
> Client ODBC driver for x86:
> http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension
> requires the Microsoft SQL Server 2012 Native Client. Access the following
> URL to download the Microsoft SQL Server 2012 Native Client ODBC driver
for
> x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] =>
> IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC
> Driver Manager] Data source name not found and no default driver specified
> [message] => [Microsoft][ODBC Driver Manager] Data source name not
> found and no default driver specified ) )
> 
> It is asking to download a native client. but i have already downloaded a
> driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098
> named SQLSRV30.EXE
> 
> why do I need a native client or ODBC driver when I already got this
driver
> installed in my system.
> 
> Please help me out with this guys. I'm new to this.
> 
> Thanks,
> Girish Talluru




--- End Message ---
--- Begin Message ---
Hi Jeff - Wonderful - Nice find. Thanks a lot

-Girish Talluru

On Wed, Sep 5, 2012 at 4:43 PM, Jeff Burcher <j...@allredmetal.com> wrote:

> Hi,
>
> I am relatively new as well. I tried both of those methods with no luck. I
> finally had success using odbc_connect(). See below:
>
> $conn = odbc_connect("Driver={SQL
> Server};Server=$server;Database=$database;", $user, $password);
>
> Thanks,
>
> Jeff Burcher - IT Dept
> Allred Metal Stamping
> PO Box 2566
> High Point, NC 27261
> (336)886-5221 x229
> j...@allredmetal.com
>
> > -----Original Message-----
> > From: Girish Talluru [mailto:girish.dev1...@gmail.com]
> > Sent: Wednesday, September 05, 2012 5:57 AM
> > To: php-gene...@lists.php.net
> > Cc: rahu...@radiare.co.in
> > Subject: [PHP] MS SQL server connection problem.
> >
> > Hi All,
> >
> > I'm having problem while connecting to MS SQL server from my php
> > program.
> >
> > I tried downloading driver from Microsoft and changed php.ini file but it
> is
> > showing the following error.
> >
> > This statement I used to connect.
> > $connect = mssql_connect("localhost", "PC6", "password");
> >
> > This is the error message I got
> > Call to undefined function mssql_connect() in
> > C:\wamp\www\Test\dbTest.php
> >
> > Then I tried other one as shown below:
> >
> >
> > This statement I used to connect.
> > $connect = sqlsrv_connect("localhost", "PC6", "password");
> >
> > This is the error message I got
> > Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code]
> => -
> > 49 [2] => This extension requires the Microsoft SQL Server 2012 Native
> Client.
> > Access the following URL to download the Microsoft SQL Server 2012 Native
> > Client ODBC driver for x86:
> > http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This
> extension
> > requires the Microsoft SQL Server 2012 Native Client. Access the
> following
> > URL to download the Microsoft SQL Server 2012 Native Client ODBC driver
> for
> > x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0]
> =>
> > IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC
> > Driver Manager] Data source name not found and no default driver
> specified
> > [message] => [Microsoft][ODBC Driver Manager] Data source name not
> > found and no default driver specified ) )
> >
> > It is asking to download a native client. but i have already downloaded a
> > driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098
> > named SQLSRV30.EXE
> >
> > why do I need a native client or ODBC driver when I already got this
> driver
> > installed in my system.
> >
> > Please help me out with this guys. I'm new to this.
> >
> > Thanks,
> > Girish Talluru
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Sep 5, 2012 7:14 AM, "Jeff Burcher" <j...@allredmetal.com> wrote:
>
> Hi,
>
> I am relatively new as well. I tried both of those methods with no luck. I
> finally had success using odbc_connect(). See below:
>
> $conn = odbc_connect("Driver={SQL
> Server};Server=$server;Database=$database;", $user, $password);
>
> Thanks,
>
> Jeff Burcher - IT Dept

ODBC may work for you, but it has issues if you need to work with text
longer than 4k if I recall.

The SQLSRV library really is the way to go. Just make sure you have the
correct SQL client library installed and use the SQL for PHP driver that
matches your PHP installation. (Threaded, non-threaded, etc.)

Andrew

--- End Message ---
--- Begin Message ---
On 09/04/2012 04:14 AM, David McGlone wrote:
Does anyone use any templeting system for any projects? If so what would
anyone recommend? I looked at Code Ignitor, but it seems the templeting system
is optional and left out by default.

- Jelix / jTpl
- Symfony / Twig

--
RMA.

--- End Message ---
--- Begin Message ---
Hi Folks..

I am trying to create web3.0 forum software from scratch.
This forum will be heavily ajax driven and preferably require no
manual page-refreshes at all anymore.

And I will also use quite a lot of tree data structures in this
design. My subforum list and my thread->messages are both
tree-structures for instance (enabling nested replies to messages).

This has led me to think, it might be better to use a JSON storage for
my data, then store that on a RAMdisk on the server, instead of using
a SQL database.
For a forum, consider this basic data-struct example (under construction ;))

dataProtocols : {
        user : {
                userID : -1,
                userTitle : '',
                userLogin : '',
                userGender : '', /* G=Group, M=Male, F=Female, T=Transsexual,
H=Hermaphrodite */
                userFirstName : '',
                userMiddleNames : '',
                userSurname : '',
                userMaidenName : '',
        },
        forum : {
                forumID : -1,
                forumName : '',
                forumDescription : '',
                subForums : [ /* forumID, forumID, ... */ ]
        },
        message : {
                threadID : -1,
                messageID : -1,
                timeSent : null,
                senders : [ /* userID, userID, ... */ ],
                to: [/* userID, userID, ... */],
                cc: [/* userID, userID, ... */],
                subject : '',
                body : '',
                replies : [/* messageID, messageID, .... */]
        },
        thread : {
                forumID : -1,
                threadID : -1,
                threadSubject : '',
                threadOpeningMessageID : -1
        }
}

and the actual in-browser javascript memory of the entire forum
content, would be, I think;

        memory : {
                users : [ /* userID, userID, ... */],
                forums : [ /* forumID, forumID, ... */ ],
                threads : [ /* threadID, threadID, ... */],
                messages : [ /* messageID, messageID, ... */],
        },


With JSON+RAMdisk storage, you could emulate shared memory on the PHP
server between all browsers connected to the site.

But the one thing that puzzles me is how to get changes made by one
browser to be displayed in all other browsers, efficiently and with
the least amount of collisions.
Obviously, an "event engine" is needed in both browser and server, and
perhaps it's best to maintain a flat list of changes made to the tree
data structures (by some browser(s)), then distribute that
changes-list to all open browsers. One could include timestamps to
make sure that no (partial) edits are made on data that has recently
been updated (this update would be transmitted to the browser editing
the same field and the user would be presented the option to
abort/update his/her own edit).

The alternative would be to spend A LOT of time building the required
SQL datastructures and PHP libraries to manipulate that SQL. I'm
really thinking it would be much simpler to just stick to JSON stored
on a RAMdisk.

I have found http://memory.dataram.com/products-and-services/software/ramdisk
to work well in conjunction with my http://www.wampserver.com/en/
This RAMdisk software is free for personal (or testing) use, and can
create RAMdisks for free of up to 500gb, and, more important, can on a
regular time interval auto-save the RAMdisk content to
(truecrypt.org-ed :) harddisk storage, plus load the RAMdisk from
harddisk storage after a reboot of course.

A forum could also use a media storage plugin, and photos and any
uploaded videos you'd just store on and read from regular harddisks of
course.
But the actual forum content, is all (html) text, and quite short usually..
So I'm guessing that with a 500mb RAMdisk, you could keep the entire
forum content for quite a large forum in RAM, and thus serve it at
lightning speed.

Now, what I'm not so sure about, is how to efficiently get changes
made to the super-global datastructure by one browser, distributed to
all other browsers in such a way that the least collisions of edits
occur. Ofcourse, adding a reply to some post on the forum would not
cause much of a problem (with other replies to the same message coming
in while the user's editing his/her reply), but for instance adding a
reply-with-quote while the original owner of the message replied to
edits his/her post, would require the person replying to be notified
(in an eye-candy-rich way ofcourse;) that the message he's/she's
replying to has changed (and preferably highlighting the change). And
I'd love some tips on how to make that last scenario easy to handle in
code.

I seem to have figured most of this out, but before I embark on weeks
of coding, I'd like to give the SQL experts here a chance to convince
me to stick to MySQL for my data storage and distribution needs. I'd
love to hear of a simple way to efficiently store and operate a forum
with tree-structures for both subforums and threads->messages using
MySQL, as my live hoster does not support RAMdisks, not without
charging me about 70 euro per month instead of the $7 I pay now ;)

Ok, thanks for reading and possibly considering all this,
 Rene

--- End Message ---

Reply via email to