Jump to content

razaqg

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

razaqg's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hello, i am currently having challenges in passing form parameters into an mssql database query from within php. I'm running running php 5 on apache 2 connecting to mssql server 2008 on windows 7. the code below is a link from a login page where the form parameter is gotten: <?php $server = 'myserver1'; // Connect to MSSQL $link = mssql_connect($server, 'user1', 'passwrd1'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } mssql_select_db('bizinfo_db', $link); $pnlusername = $_POST['pnlusername']; $pnlpassword = $_POST['pnlpassword']; $query = mssql_query('SELECT Title, Surname, FirstName FROM PeoplesRec where Username = '$pnlusername' '); if (!$result) { die('Query failed.'); } // Select every 4th student in the results for ($i = mssql_num_rows($result) - 1; $i % 4; $i++) { if (!mssql_data_seek($result, $i)) { continue; } // Fetch the row ... } if (!$result) { die("Database"); } // Free the query result mssql_free_result($result); // Close the link to MSSQL mssql_close($link); ?> what could be wrong in the parameter assignment as highlighted in red. Regards.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.