Jump to content

johnson.sh

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

johnson.sh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there! I'm trying to update my project to work with the new MS SQLSRV driver. I've installed the driver and it works ok. Before the MS driver i had a connection to the sql server (connect.php) and included it on every page. Now, i'm trying to do the same but some commands, i.e SQLSRV_QUERY require the $conn (connection resource) as a parameter. That resource cannot be passed from the connect.php (or maybe i don't know how to do it properly). So my question is - Do i need to connect again using SQLSRV_CONNECT on every page? My setup: WAMP 2.1, MSSQL 2008 @ WIN Server 2008 Thanks in advance.
  2. When i don't include the head.php file it's all working. so all i could think of is that something from that file had to do to my problem. It's very strange that this little change made it all work, but until now all of my tests worked great.
  3. Hi all, i went thourgh of head.php file that i inculded on the top of the page. finally i found this line: <table background="#E8EEFA"><td></td><div class="logo"></div></table> after chaning this line to <table bgcolor=#E8EEFA><td></td><div class="logo"></div></table> it all worked! it's quite weird becouse this head.php is working ok on all of my other pages.. if one of you knows why i'll be happy to know! anyway thanks for your help guys!
  4. hey Mark, i double checked this and there is no duplicate values for strMac. I'm fetching all data from the table after i run the php script to see changes. MrAdam thanks for the information.
  5. Hey ignace thanks for the quick reply. nothing changed, it still doesn't work and deleting 2 rows instead of 1. btw, strMac = strMAC in MSSQL query?
  6. Hi all! I'm trying to fetch the first item from MSSQL table, save it into php variable and then delete it from the table: table name - tblMACJumpPool [ intBlockID(int), strMac(varchar12) ] values: 12,1 12,2 12,3 12,4 My Code: [code <?php include("connect.php"); include("head.php"); function GetJumpMAC($block_id) { $get_jump_query = "SELECT strMAC FROM tblMACJumpPool WHERE intBlockID = '$block_id'"; $get_jump_result = mssql_query($get_jump_query) or die('Error, select query failed'); while($row_jump = mssql_fetch_array($get_jump_result, MSSQL_ASSOC)) { $jump = "{$row_jump['strMAC']}"; return $jump; //echo "Current-->" . $jump . "<br>"; } } $counter=1; $get_n=1; $get_b_id=12; while ($counter <= $get_n) { $jumpmac = GetJumpMAC($get_b_id); //$jumpmac='2'; $delete_query = "DELETE FROM tblMACJumpPool WHERE strMac = '$jumpmac'"; mssql_query($delete_query) or die('Error, delete query failed'); $counter++; } Now the problem is that when i run this php page, 2 rows being deleted instead of 1! when i remove the include for 'head.php' all works fine, but this file included in all of my pages.. also when i unmark //$jumpmac='2'; , it will delete only 1 row as it suppose to do. so i'm very confused I done it lots of times and it worked this way, but this time it doesn't work good. Hope you can help me, thanks in advance!
×
×
  • 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.