Created
May 27, 2011 17:27
-
-
Save andrewwatson/995732 to your computer and use it in GitHub Desktop.
A snippet to illustrate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace this code: | |
/* Create an Array of people to be called */ | |
$people = array( | |
0 => "415-555-1234", | |
1 => "415-555-2345", | |
2 => "415-555-3456" | |
); | |
With this: | |
$sql = "SELECT phone_number, name FROM poll_takers"; | |
$query = mysql_query($sql); | |
$people = array(); | |
while($row = mysql_fetch_row($query, MYSQL_ASSOC)) { | |
$people[] = $row['phone_number']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `poll_takers` ( | |
id int auto_increment not null primary key, | |
phone_number varchar(20) not null default '', | |
name varchar(20) not null default '' | |
); | |
INSERT INTO `poll_takers` (phone_number, name) VALUES | |
('+14045551212', 'Bob'), | |
('+17705551212', 'Sam'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment