Logo
Explore Help
Sign In
arman/science-ation
1
1
Fork 0
You've already forked science-ation
forked from science-ation/science-ation
Code Pull Requests Activity
50a719ef12
BranchesTags
View all branches
science-ation/db/db.update.81.php

14 lines
343 B
PHP
Raw Normal View History

- Select the first contact for each sponsor as the primary - Prevent the user from setting zero, or more than one, primary contact. - Add a primary column to the contacts table, so they can see the automatic set/unset operations on the primary contact.
2007-12-13 21:50:31 +00:00
<?
function db_update_81_post()
{
Mysql conversion
2024-12-10 19:40:23 -05:00
$q = $pdo->prepare("SELECT DISTINCT award_sponsors_id FROM award_contacts");
$q->execute();
while($i = m$q->fetch(PDO::FETCH_OBJ)) {
- Select the first contact for each sponsor as the primary - Prevent the user from setting zero, or more than one, primary contact. - Add a primary column to the contacts table, so they can see the automatic set/unset operations on the primary contact.
2007-12-13 21:50:31 +00:00
$asid = $i->award_sponsors_id;
Mysql conversion
2024-12-10 19:40:23 -05:00
$stmt = $pdo->prepare("UPDATE award_contacts SET `primary`='yes' WHERE award_sponsors_id='$asid' LIMIT 1");
$stmt->execute();
- Select the first contact for each sponsor as the primary - Prevent the user from setting zero, or more than one, primary contact. - Add a primary column to the contacts table, so they can see the automatic set/unset operations on the primary contact.
2007-12-13 21:50:31 +00:00
}
}
?>
Copy Permalink
Powered by Gitea Page: 131ms Template: 5ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API