-1

I've looked at other similar questions about this topic, but I couldn't find what am I missing.

I am trying to convert my mysql_ codes to the PDO, but although first part is very simple yet I couldn't deal with it. What am I doing wrong? Also I have to use utf8, otherwise I'm getting characters problem.

So my issue is:

Use of undefined constant IL_ADI assumed 'IL_ADI'

I've tried $oku['IL_ADI'] and no data was returned.

$dab = new PDO("mysql:host=localhost; dbname=datauser; charset=utf8" ,'user_user' , 'password');
$dab->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$dab->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

$query = 'SELECT * FROM iller ORDER BY IL_ADI';

$result= $dab->query($query);
while($oku=$result->fetch(PDO::FETCH_ASSOC)){

    print_r ("<option name='ilsec' value=''");
    print_r ($oku[IL_ADI]);
}
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
ozan
  • 1
  • 3

1 Answers1

0
print_r ("<option name='ilsec' value=''");

to

print_r ("<option name='ilsec' value=''>");

I've forgot to put > . After adding that the data has come. But other problems came along:) Thank you everyone for the quick answers.

ozan
  • 1
  • 3