Jump to content

Recommended Posts

Im trying to extract data form a ms sql (2008) datasource. i use the following code:

 



mssql_connect($server, $user, $password);
mssql_select_db($database);

$query = "SELECT * FROM dbo.vw_Export_relaties";
$result = mssql_query($query);


$fields = "Relatie_Id, Relatie_AdministratieKlantNummer,RelatieType_Omschrijving,Branche_Omschrijving,Relatie_RelatieZoeknaam,Relatie_Naam,";
$fields .= "Relatie_BezoekStraat,Relatie_BezoekHuisnummerNumeriek,Relatie_BezoekHuisnummerToevoeging,Relatie_BezoekPostcode,";
$fields .= "Relatie_BezoekStraat,Relatie_BezoekPlaats,Relatie_BezoekGemeente,Relatie_BezoekProvincie,Relatie_PostStraat,";
$fields .= "Relatie_PostHuisnummerNumeriek,Relatie_PostHuisnummerToevoeging,Relatie_PostPostcode,Relatie_PostPlaats,Relatie_PostGemeente,";
$fields .= "Relatie_PostProvincie,Relatie_Telefoonnummer,Relatie_Faxnummer,Relatie_Mobielnummer,Relatie_Emailadres,";
$fields .= "Relatie_Website,Relatie_MedewerkersAantal,Relatie_VerhuureenhedenAantal,RelatieStatus_Omschrijving,Relatie_soort_omschrijving,Relatie_Reden_niet_actief";


$field = explode(",", $fields);
echo mssql_field_type($result, "Relatie_BezoekHuisnummerNumeriek");

$count = count($field);

echo("<table>");

echo("
<TR>
");

for($i = 0; $i < $count; $i++)
{
echo("
	<TD style='border: 1px solid black'>
		{$field[$i]}
	</TD>
");
}

echo("
</TR>
");

while ( $record = mssql_fetch_array($result) )
{
echo("
<TR>
");

for($z = 0; $z < $count; $z++)
{
	echo('
		<TD style="border: 1px solid black;">
			'.$record[$field[$z]].'
		</TD>
	');
}

echo("
</TR>
");

}

echo("</table>");

mssql_close();

 

Every value is filled however i am getting blank values for Relatie_BezoekHuisnummerNumeriek, Relatie_BezoekHuisnummerToevoeging

 

I am accessing a view where i posses read premissions. The values that arent returnd are int and varchar(255) however others alsow

have this type and are returned. I dont understand why these specific values aren't returned.

 

Can anybody help me ??????

 

Thanks in advance....

 

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/184507-blank-values-in-result/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.