خرید بک لینک

Vote count: 0

I have a PHP file that will run a SQL select statement and echo out the results. I am trying to be able to set individual columns to specific variables. Is this possible?

IE: based on the code below, how could I create a variable called $FirstName and set it equal to the value of the single record in the column firstname that is retued?

Thank you

   $sql = "SELECT * FROM Employees where Employee_ID = 1";
  $stmt = sqlsrv_query( $trpCo, $sql );
  if( $stmt === false) {
    die( print_r( sqlsrv_errors(), true) );
  }

  while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
    echo $row['FirstName'].", ".$row['LastName']."<br />";
  } 

asked 4 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 30 فروردين 1395 ساعت: 21:43

صفحه بندی