Thanks Philm, thats just what I needed to know!
I have a database setup now, id # 1 has a gbp value of 50 and usd of 100 for testing, when i use the following php though:
Code:
<?php
include 'db.php';
$usrValue = 100 ;
$get = mysql_query("SELECT gbp FROM crncy where usd = $usrValue") or die("Mmm pie:" . mysql_error());
while ($row = mysql_fetch_row($get)) {
echo $usrValue ;
}
?>
It echos 100..
What have I done wrong?
Thanks in advance
Tjobbe
MYSQL Database dump:
Code:
# phpMyAdmin SQL Dump
# version 2.5.6
# http://www.phpmyadmin.net
#
# Host: localhost
# Generation Time: Nov 24, 2005 at 05:01 PM
# Server version: 4.0.18
# PHP Version: 4.3.6
#
# Database : `tblmoney`
#
# --------------------------------------------------------
#
# Table structure for table `crncy`
#
CREATE TABLE `crncy` (
`id` tinyint(4) NOT NULL auto_increment,
`gbp` text NOT NULL,
`usd` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
#
# Dumping data for table `crncy`
#
INSERT INTO `crncy` VALUES (1, '50', '100');
Bookmarks