OK, I think I'm making some progress. I'm getting an error stating"
*Fatal error*: Only variables can be passed by reference in */path to
file*on line
*18*
The contents of my file are:
<?php
require 'credentials.php';
$location_id=$_POST['location_id'];
$description=$_POST['description'];
$wh_id=$_POST['wh_id'];
// Connect to MSSQL
mssql_connect('$dbserver');
mssql_select_db('$database');
// Create a new stored prodecure
$stmt = mssql_init('SP_stored_procedure');
// Bind the field names
mssql_bind($stmt, '@location_id', '$location_id', VARCHAR,
false, false, 13);
mssql_bind($stmt, '@description', '$description', VARCHAR,
false, false, 50);
mssql_bind($stmt, '@wh_id', '$wh_id', VARCHAR,
false, false, 10);
// Execute
mssql_execute($stmt);
// Free statement
mssql_free_statement($stmt);
?>
Am I assigning the variables incorrectly? I've found several things stating
there were bugs in php pertaining to this from version 5.05 to 5.1.3. We
have 5.1.4 installed.
Any suggestions?
On Tue, Mar 17, 2009 at 8:08 PM, Mac Newbold <[email protected]> wrote:
> Today at 6:08pm, Brady Mitchell said:
>
> On Tue, Mar 17, 2009 at 1:03 PM, Caleb Call <[email protected]> wrote:
>>
>>> I'm trying to use mssql_connect, but I'm not opposed to using another
>>> method of
>>> connecting if it's better. Any help would be appreciated.
>>>
>>
>> I've only used MS SQL and PHP together once, and I was never able to
>> get it working using the built-in functions on their own. Using adodb
>> (http://adodb.sourceforge.net/) worked well for me:
>>
>> $conn =& ADONewConnection('odbc_mssql');
>> $conn->Connect($dsn_name,$db_user,$db_passwd);
>>
>
> The two main methods (not counting things that layer on top of them, like
> adodb) are directly (MSSQL extension) and ODBC (ODBC extension). From a
> linux box you usually need FreeTDS as well (especially for MSSQL method) but
> in this case that won't be necessary.
>
> Generally there's some installation to do to make sure you have compatible
> versions of all the DLLs. Last I checked, the online resources, starting
> with php.net user comments in the manual, and following up with Google,
> gave good answers and chances are really good someone else ran into any
> problem you ran into and documented a solution eventually.
>
> Last time we set up an MS SQL connection on a windows box from PHP I think
> we eneded up needing to use ODBC because the direct way was never happy with
> the versions of DLLs we had (aka DLL Hell, one program needs one version and
> another program can't work with that version). With ODBC there are a bunch
> of connections you need to configure before it works, if I remember right.
> There's a level of that with the "direct" way too.
>
> Thanks,
> Mac
>
> --
> Mac Newbold Code Greene, LLC
> CTO/Chief Technical Officer 44 Exchange Place
> Office: 801-582-0148 Salt Lake City, UT 84111
> Cell: 801-694-6334 www.codegreene.com
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net