Forum Moderators: coopster

Message Too Old, No Replies

creating a php sql script new project for virtual site money

         

jamied_uk

6:00 pm on Oct 12, 2011 (gmt 0)

10+ Year Member



i have a user database setup and have uploaded the sql structure to jnet2012.0fees.net/attachments


i would like the sql to be so that another table called balance is there and php files to add a text box input of the amount and also a selection box so i can select who balance is edited once these simple funtions are in place i can extend it later for when a visitor logs in or visits a page there session logged in user name will be used to add x amount of free credits to there acount balance



later will be free things as gifts and also gifts to send to other users etc.


this script i feel will be very usefull for all web masters wanting new guests to sites


my skills are very limited and get stuck on syntax etc


i want pages made in php 1 showing all balences in desc order
a page so i can have a input box for the username or from a list somehow with amount edit input box that shows whats currently in that users balence


on a 3rd page i need an example page that when it is included with another php file (index for example) it will give that user a little extra points for using the site for example



then from this i can add multipliers etc and add bits for games etc


any one help me with this i have ideas but no nothing of real syntax when using php and mysql together in this way and want to add to my current database sql is in attachments and hopefully in the same place as users id tables can be added a field called balance



i have got this far but cant get passed making these 3 simple pages as described above these are the most important as involves php

[edited by: coopster at 1:31 pm (utc) on Oct 15, 2011]
[edit reason] removed share portion as not necessary [/edit]

httpwebwitch

4:51 pm on Oct 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i have ideas but no nothing of real syntax when using php and mysql together


This will be your biggest hurdle. You'll have to learn how to use PHP and MySQL together, which is a topic too broad to be covered in a forum post reply.

There are lots of books on the subject, online tutorials, etc. It doesn't take much searching to find them.

jamied_uk

5:54 pm on Oct 14, 2011 (gmt 0)

10+ Year Member



read alot but more i read more confused i get theres more than 1 way to do things lol so anyway im getting this eeror


You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

and $ variables are getting ignored and do not know why

Readie

6:52 pm on Oct 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



and $ variables are getting ignored and do not know why

I'm gonna go ahead here and guess your SQL is something along the lines of
$sql = '
SELECT
*
FROM
my_table
WHERE
column_name = $first_variable
AND other_column_name = $second variable
';


Am I on the right sorta lines?

jamied_uk

7:41 pm on Oct 14, 2011 (gmt 0)

10+ Year Member



yes maybe but i have uploaded the files so we can all gain out of it no point if there's not a lesson to be learnt but the more input the better

basically a login file should set session var for id and user name etc and also the balance as i want to pull data from the logged in users balance using there user id if it possible to make this happen for the purposes of testing and learning i have uploaded the whole project and more to dir

jnet2012.0fees.net/attachments

jamied_uk

8:40 pm on Oct 14, 2011 (gmt 0)

10+ Year Member



i resolved this issue with this variable

$id = $_SESSION['user_id'];