PHP Issues

Hey all,

Been a while since ive coded php and am stuck already.
Here is the issue, i have a list being made from the database using id as the identifier. so the link being rendered is client.php?id=1 etc.

im trying to use this info to populate the page it directs too using the folowing add on script:

[php]<?
$lin = mysqli_connect("","","!","") or die("Error 1 " . mysqli_error($lin));

//consultation:

$query = "SELECT * FROM Clients WHERE ID=1 " or die(“Error 2 in the consult…” . mysqli_error($lin));

//execute the query.

$result = mysqli_query($lin, $query);

while($row = mysqli_fetch_array($result)) {
$name = $row[‘1’];
$address = $row[‘2’];
$city = $row[‘3’];
$postcode = $row[‘4’];
$phone = $row[‘5’];
$email = $row[‘6’];

}
?>
[/php]
Problem is this isnt working and i have no idea why

Can anyone help?

Just a random guess, without looking your code, you are using Short Tags and I bet you don’t have that enable in your php.ini…

Try changing

[php]<?[/php]

to

[php]<?php[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service