WebFaction
Community site: login faq

Could you fix the PHP mysql example at "Accessing a Database from a Script or Application" on:
http://docs.webfaction.com/user-guide/databases.html#accessing-a-database-from-a-script-or-application
as highlighted?

<?php
mysql_connect("127.0.0.1", "user123_mysql_db", "averysecurepassword");  
mysql_select_db("user_123_mysql_db") or die("Unable to select database");  
$result = mysql_query("SELECT * FROM names");  
mysql_close();  
// ** This does not do what you intend. Just shows: "Resource id #n"  
// echo($result);  
// This does.  
while ( $row = mysql_fetch_row($result) ) {  
echo implode(" ", $row), "\n";  
}
?>

asked 29 Jun '12, 19:03

flathat
11
accept rate: 0%

edited 29 Jun '12, 19:49

ryans ♦♦
5.0k93360

Thanks! I've tested this and you are correct.

I've scheduled this change for review.

(29 Jun '12, 19:54) ryans ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×168
×8
×5

question asked: 29 Jun '12, 19:03

question was seen: 1,834 times

last updated: 29 Jun '12, 19:54

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM