Bir sabun hizmeti kullanarak bir php client-> çağrısı sözdizimi ile ilgili soru

1 Cevap php

Yani ben burada başladığımda ben "miras" çalışması için bir site üzerinde çalışıyorum, ve ben yani sabun hizmetleri, aşina olduğum kod bir çok ile yüzmek için yaşıyorum. Web sitesi Bu createURL servisi kullanarak db bazı şeyler yazmak sağlayan bir özelliği vardır:

$res = $db->Exec('INSERT INTO private_urls (UID, psswrd, profile_id, show_profile, show_portfolio, show_resume, show_message, show_email, show_phone, show_eportfolioaddress, show_major, show_minor, show_academic_interests, show_research_interests, show_career_interests, show_job_interests, created, modified, urlName) VALUES ( ? , ? , ? , ? , ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), NOW(), ?)', 'sssssssssssssssss', $uid, $password, $profile_id, $profile, $portfolio, $resume, $messages, $email, $phone, $eportAddress, $major, $minor, $academicInterests, $careerInterests, $researchInterests, $jobInterests, $urlName); 

Şimdi, benim işim (Ben yaşıyorum sorun) yinelenen bir girişi olduğunu db girişini düzenlemek, ve böylece onu yapmaktır. Ben yeni formlar yapılmış, ve bir editURL servisine bağlantı ilişkili php dosya I oluşturmak benzer yaptı.

MY QUESTION: o NEREDE private_urls.uid =? Geçirilen bu değerlerin tüm db güncellemeleri, böylece bu sql deyimi düzenleme sözdizimi Saygılar. Ben sözdizimi WHERE yan tümcesi ile gitmek gerekiyordu anlamaya olamaz. Bu benim ne var:

$res = $db->Exec('UPDATE private_urls (UID, psswrd, profile_id, show_profile, show_portfolio, show_resume, show_message, show_email, show_phone, show_eportfolioaddress, show_major, show_minor, show_academic_interests, show_research_interests, show_career_interests, show_job_interests, created, modified, urlName) WHERE private_urls.UID = ? VALUES ( ? , ? , ? , ? , ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), NOW(), ?)', 'ssssssssssssssssss', $uid, $uid, $password, $profile_id, $profile, $portfolio, $resume, $messages, $email, $phone, $eportAddress, $major, $minor, $academicInterests, $careerInterests, $researchInterests, $jobInterests, $urlName); 

Açıkçası düzgün çalışmıyor, ve benim merak ediyorum? WHERE yan tümcesi aşağıdaki doğru çoğaltılamaz $ uid değişkenleri birinci ile ilişkili varlık değildir ...

Herhangi bir düşünce?

1 Cevap

Sizin UPDATE sözdizimi doğru değil, sen (kısalık için simplifed) böyle bir şey istiyorum

$res = $db->Exec('UPDATE private_urls '.
    'SET psswrd=?, profile_id=?,modified=NOW() '.
    'WHERE UID=?', 
    $password, $profile_id, $uid);