prototype Posted November 19, 2017 Share Posted November 19, 2017 Herkese hayırlı akşamlar. Url Yapısı : http://localhost/cari?id=1 ID müşteri id'si oluyor. Aşağıdaki kodda görmüş olduğunuz gibi Müşteri ID numarası manuel girilmiş ancak ben buraya URL'den gelen kodu yansıtmak istiyorum. Birkaç seçenek denedim ancak sonuç alamadım. Yardım edebilecek arkadaşlara şimdiden teşekkürler. <?php try { $db = new PDO('mysql:host=localhost;dbname=t-caridb', 'root', ''); $db->exec("SET NAMES 'utf8'; SET CHARSET 'utf8'"); } catch (PDOException $e) { die($e->getMessage()); } $query = $db->query("SELECT SUM(`alinan`) AS `alinan` FROM `cariharehetler` WHERE `musteriid`='1'"); $toplam2 = $query->fetchColumn(); echo $toplam2; ?> Quote Link to comment Share on other sites More sharing options...
xNeox Posted November 19, 2017 Share Posted November 19, 2017 $query = $db->query("SELECT SUM(`alinan`) AS `alinan` FROM `cariharehetler` WHERE `musteriid`='".$_GET['id']."'"); yapman yeterli olacaktır 1 Quote Link to comment Share on other sites More sharing options...
prototype Posted November 19, 2017 Author Share Posted November 19, 2017 xNeox, 5 dakika önce yazdı: $query = $db->query("SELECT SUM(`alinan`) AS `alinan` FROM `cariharehetler` WHERE `musteriid`='".$_GET['id']."'"); yapman yeterli olacaktır çok teşekkürler. bu sefer oldu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.