Merhaba,

Tahminim $topic_* olan atamaları bind_Param'dan önce yapmanız gerekiyor.
Öteki türlü bindParam olarak boş değerler ile işletilir.

İyi çalışmalar.


8 Ocak 2014 12:42 tarihinde Erdem Uyguner <[email protected]> yazdı:

> mysql^'den PDO'ya geçeyim dedim başım dertten kurtulmuyor. Yanlış mı
> yapıyorum onuda anlamadım ekran çıktısı 1,1,1 olarak geliyor ama
> veritabanında hiç bir değişiklik yok...
>
> <?php
> $db_host = "127.0.0.1";
> $db_user = "root";
> $db_pass = "";
> $db_name = "test";
>
> try {$db = new PDO("mysql:dbname=$db_name;host=$db_host", $db_user,
> $db_pass );}
>     catch(PDOException $e){echo $e->getMessage();}
>
> $title_insert = $db->prepare("UPDATE topics SET topic_title = ? WHERE id =
> ?");
> $title_insert->bindParam(1, $topic_id);
> $title_insert->bindParam(2, $topic_title);
>
> $tag_insert = $db->prepare("UPDATE topics SET topic_tags = ? WHERE id =
> ?");
> $tag_insert->bindParam(1, $topic_id);
> $tag_insert->bindParam(2, $topic_tags);
>
> $story_insert = $db->prepare("UPDATE topics SET topic_story = ? WHERE id =
> ?");
> $story_insert->bindParam(1, $topic_id);
> $story_insert->bindParam(2, $topic_story);
>
> $topic_id = 1;
> $topic_title = "title";
> $topic_tags = "tags";
> $topic_story = "story";
>
> $sonuc_title = $title_insert->execute();
> echo $sonuc_title.'<br />';
>
> $sonuc_tag = $tag_insert->execute();
> echo $sonuc_tag.'<br />';
>
> $sonuc_story = $story_insert->execute();
> echo $sonuc_story.'<br />';
> ?>
>
> _______________________________________________
> Linux-programlama mailing list
> [email protected]
> https://liste.linux.org.tr/mailman/listinfo/linux-programlama
> Liste kurallari: http://liste.linux.org.tr/kurallar.php
>
>
_______________________________________________
Linux-programlama mailing list
[email protected]
https://liste.linux.org.tr/mailman/listinfo/linux-programlama
Liste kurallari: http://liste.linux.org.tr/kurallar.php

Cevap