Selecting variables out of a database..

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Selecting variables out of a database..

Post by bobthebobert »

Hi it's me again, unfortunatly =/

Ok, I have gotten down the whole insert into a table thing, but I can't seem to be able to print anything I get out of the table, all it tells me is "Resource id#2".

Heres what I got so far, before this there is a form..

Code: Select all

<?php

$name = $_POST["name"];
$password = $_POST["name"];
$kingname = $_POST["kingname"];
$rulername = $_POST["rulername"];
$link = mysql_connect("localhost:3306", "The Master", "")
	or die("Could not connect: " . mysql_error());
mysql_select_db('wwone');

//there is already a table called info, and the first column is called rulername//

$col = mysql_query("SELECT rulername FROM info");
echo "$col";

?>
Grr, how would I get this to work!?!
craigh
Forum Newbie
Posts: 19
Joined: Sun May 19, 2002 2:50 pm

Re: Selecting variables out of a database..

Post by craigh »

Post Reply