Jump to content

whiteboikyle

Members
  • Posts

    286
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

whiteboikyle's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Not really sure what to put for the "Options" Array to fix this query though.
  2. It must be a security issue than. I will look into. Its a direct copy and paste in the query and it pops up rows.. And E_ALL is on.. No errors.
  3. I made sure it was the right directory.. I even did $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC); var_dump($row); and still comes up bool false.. Im thinking maybe a security to the tables?
  4. So we have Sharepoint and I am trying to extract certain information from the sharepoint SQL and code a page to output that data. This is what i have: <?php $serverName = "127.0.0.1"; $connectionInfo = array("Database"=>"SharedServices_DB"); $conn = sqlsrv_connect($serverName, $connectionInfo); var_dump($conn); echo("<br />"); $sql = "SELECT TOP 100 Name = upf.PreferredName, Email = upf.Email, Modified = upf.LastUserUpdate, Property = pl.PropertyName, Value = upv.PropertyVal FROM dbo.UserProfile_Full upf, dbo.UserProfileValue upv, dbo.PropertyList pl WHERE upv.RecordID = upf.RecordID AND pl.PropertyID = upv.PropertyID ORDER BY Name ASC"; $stmt = sqlsrv_query($conn, $sql); if( $stmt === false ) { die( print_r( sqlsrv_errors(), true)); } var_dump($stmt); echo("<br />"); $row_count = sqlsrv_num_rows( $stmt ); var_dump($row_count); while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { var_dump($row); //$second = $row['Department']; //if($first != $second){ //if($row['Name'] != NULL || $row['Email'] != NULL){ echo('<div id="department">'.$row['Name'].'</div><hr />'); //$first = $row['Department']; //} } sqlsrv_free_stmt( $stmt); ?> I know for sure the $sql works I manually did the query on the sql server and it output all the data i needed. But on the PHP site it is coming up blank not outputting anything. Here are the results of the var_dump
  5. Why would I do that when I am running server 2003?
  6. I'm running: Windows Server 2003 IIS 6.0 Microsoft SQL 2005 PHP 5.3.28 Everything that i have read says, "5.3 got rid of mssql and now uses sqlsrv" so i added extension=php_sqlsrv_53_nts_vc9.dll to my php.ini (and yes it is in the ext folder) and when i run the script $serverName = "localhost\phonebook"; //serverName\instanceName // Since UID and PWD are not specified in the $connectionInfo array, // The connection will be attempted using Windows Authentication. $connectionInfo = array( "Database"=>"XXXXX", "UID"=>"XXXXX", "PWD"=>'XXXXXXXX'); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established.<br />"; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } i get
  7. Im use to PHP and doing a query seems similar but i need help with syntax. I have an XML file that looks like this and i am trying to do a query where it will search for "ES2UA1" and i get the data "IP" and "Location" I know i am some where in the ball park with Dim doc = XDocument.Load(My.Application.Info.DirectoryPath & ".\xmlData.xml") Dim marker2 = From x In doc...<switchIP> _ Where x.SwitchName = "ES1UA1" _ Select x for each x as y msgbox(y.IP)
  8. Thanks for trying to help but im trying to make the search bar INSIDE the input field.
  9. Is this possible? Pretty much can you do [search here (q)] the q is the search button. IE
  10. THANKS! another question this doesnt really regard that, well kinda, but lets say i exploded it like so $fullName = 'kyle cribbs' $name = explode(' ', $fullName); how would i do a 'like' SQL using an array? like this? SELECT * FROM `users` WHERE `name` LIKE '%$name%'
  11. $name = 'Kyle Cribbs'; how to make this into an array like $array[0] = Kyle; $array[1] = Cribbs; I know there is a php function that will do this but dont know what it is -.- haha
  12. Sorry was originally posted in the framework (which is what im using) but it seems to lack people in that thread so i posted over here.
×
×
  • 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.