Created
January 1, 2010 15:41
-
-
Save ethnt/267144 to your computer and use it in GitHub Desktop.
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
<?php | |
/* Finito | |
* A social lifestreaming application. | |
* Revision 0.1.1 | |
* | |
* system/includes/models.php | |
*/ | |
# This file prepares all the database interaction for the views (/system/views/.). | |
// Connect to MySQL | |
$connect = mysql_connect($host, $user, $pass) or die($error = 'Could not connect to MySQL database.'); | |
$select = mysql_select_db($name) or die($error = 'Could not select MySQL database.'); | |
// Get the updates | |
$updateQuery = mysql_query("SELECT * FROM updates"); | |
while($updateArray = mysql_fetch_array($updateQuery)){ | |
$updateID = $updateArray['id']; | |
$updateNetworkID = $updateArray['networkID']; | |
$updateDate = $updateArray['date']; | |
$updateContent = $updateArray['content']; | |
$updatePermalink = $updateArray['permalink']; | |
} | |
// Get the networks | |
$networkQuery = mysql_query("SELECT * FROM networks"); | |
while($networkArray = mysql_fetch_array($networkQuery)){ | |
$networkID = $networkArray['id']; | |
$networkName = $networkArray['name']; | |
$networkUser = $networkArray['username']; | |
$networkFeed = $networkArray['feedURI']; | |
$networkProfile = $networkArray['profileURI']; | |
} | |
/* | |
This is giving the following error: | |
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/finito/system/includes/models.php on line 29 | |
What is the problem here? | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment