Jump to content

LikeCoding

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LikeCoding's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Interesting, that awake much thoughts. I really hate ads by myself but the sizes that I took was not perfect so I could only use the bigger ones. About the first impression "what this site is for" is something I really have to work on. Thanks for commenting that. I don't know what a dummy copy is but I hopefully find out. Also, I will change the place of the text of coins tutorial, thanks again for all information
  2. Maybe it's your bandwidth or if your using another server's host connection that's slow.
  3. Hi everyone. I just got finish with the layout for my website I've been working on for a while! Everything is "hand"made and I am very proud of it (design, images but not all php). So now back to the subject. I made this thread because I want to know what others think about it. It's so hard to see things when making stuff by yourself. Hopefully someone can just point out what's good and bad. Thanks so much for visiting and commenting. The link can be found here.
  4. Thanks a bunch! Now it maybe sounded simple but now I see the problem. Got stuck with the "if user got points for the avatar name" place now. But I'll keep trying. Join is probably the right way to go.. // Make a MySQL Connection // Construct our join query $query = "SELECT coins, price ". "FROM members, avatar ". "WHERE user = '{$_SESSION['sess_user']}'"; $result = mysql_query($query) or die(mysql_error()); // Print out the contents of each row into a table while($row = mysql_fetch_array($result)){ echo $row['coins']. " - ". $row['price']; echo "<br />"; if($row['coins']<10) { // if I change it to $row['price'] I guess it wont work so I better fix this^^ echo "You need more cash!!"; } else { echo "you have over 1 coins"; } } Anyway, I will probably make it. Thanks again
  5. MySQL client version: 5.0.51a I got two tables called: Members and avatar. In members I got both user and coins. The other one is called Avatar with price and name columns. -- -- Table structure for table `avatar` -- This is how the avatar table looks like `id` int(11) NOT NULL auto_increment, `name` varchar(41) NOT NULL default '', `price` int(50) default NULL, `nick` varchar(50) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 -- -- Table structure for table `members` -- This is how the members table looks like `id` int(11) NOT NULL auto_increment, `user` varchar(30) NOT NULL default '', `pass` varchar(41) NOT NULL default '', `name` varchar(50) NOT NULL default '', `email` varchar(50) NOT NULL default '', `coins` int(25) default '0', `savatar` varchar(15) NOT NULL default 'bullet.gif', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; So I tell again: I want to take the price value from the name in avatar and minus that with the coins value for the logged in user. Also going to need somehow "check" if the users coins is more or equal with the price. I've been searching for a long time how to complete this "buy"-script but I need some serious help.
  6. $query = "SELECT coins, price ". "FROM members, avatar ". "WHERE user = '{$_SESSION['sess_user']}', name = '{$_POST['item']}'"; $result = mysql_query($query) or die(mysql_error()); // Print out the contents of each row into a table while($row = mysql_fetch_array($result)){ echo $row['coins']. " - ". $row['price']; echo "<br />"; } Hello hello people I hope this forum is the right place for me. I try explain as good as I can. I have this two tables that I want to pick out two rows and compare them. Right now I just write them out for testing. Anyhow... I have tried a lot of different syntax variants but I've come this far (see code). I want to do "WHERE" statement on two tables, is that possible? If you are curious the tables are: avatar and members. That I going to do is take price (from avatar table) and subtract the value with coins from members. ERROR: Column 'name' in where clause is ambiguous
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.