Bradley99
Members-
Posts
148 -
Joined
-
Last visited
Never
Everything posted by Bradley99
-
I can get it to list events, but not in a drop down! Any help is appreciated.
-
Thanks Psycho you got it spot on! I think I was just rushing things and trying not to have more than 2 tables for the full thing, but makes more sense and easier to do a table for everything. Thanks everyone who helped!!
-
I have no idea how to auto increment two columns in 1 table though? I currently have Betting Table as you said, Now I have events table & fights table - the latter two are for my own use for adding events and adding fights to events.
-
Actually can't seem to find the 'mark as solved' button?
-
So here's how I tried it. . $eventname = mysql_fetch_object(mysql_query("SELECT * FROM events ORDER by event_id ASC")); while($row = mysql_fetch_array($eventname)); With <tr> <td class="subtableheader"><b>Event:</b></td> <td class="profilerow"><select name=event><option value=1><?php echo "$row"; ?></option></td> </tr> And i get error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in . . . on line 28 Line 28 is the "while($row = mysql. . . )
-
I can run a SELECT query and echo the values, but not in a while() loop, any help on that would be appreciated.
-
I'm stuck on how to actually get the options from the database, something I've never done before, I was thinking it would be similar to fetching and ordering articles or something like that?
-
So, I want the normal drop down like so. . . <select name=. . . . > <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> but I wan't the options to come from my DB. Any help is appreciated.
-
I already have auto incrementing on the bet_id table though? Any idea's? I suppose I could ENTER my own match ID when i create the fights, Silva vs Sonnen = 'slvavssonen' type thing, It's just then keeping up with them making sure i dont repeat.
-
So, I have a table in my DB, Betting. It's for a kinda fantasy pick'em/betting game. My table is as follows. . .(It's for MMA). bet_id match_id user_id fighter_id method round bonus Now, I need to have a different MATCH ID for EVERY fight that users pick for. So Guy1 vs Guy2 the Match ID is 1. Guy3 vs Guy4 the Match ID is 2. I need it to be this so when I update the results of the fights, I can do IF match_id = '2' AND fighter_id = '1' UPDATE. . . . . How can I make so this happens? ANY help is appreciated. (Please bare in mind, I'm using no CMS or anything, I have created a very basic Admin back-end.)
-
Sorry, I was being blatantly stupid! Haha! Thanks anyway, topic can be closed.
-
Evening, I know this is going to turn out to be something very simple, But for the life of me I can't figure. I'm trying to get it so that when A form is submitted, the Users ID is sent to the user_id column in the DB. But as above, I'm dumbfounded. Thanks
-
Thanks Mahngiel! That's what I'm looking (was looking) for!! I'm gonna get it done tomorrow I'll let you know how I get on and what method I use! Thanks for all the help guys!
-
I think that's what I was missing, the Betting table, I have User table & Match (Event) table, I think I just need to add the Betting table! I'm just struggling on how to layout the table in terms of picks, because for each event there is 10+ picks. I didn't wanna over complicate things. Thanks
-
I think maybe I'll change DB so that the events table is more like. . Username - Pick 1 - Pick1 Method - Pick1 Round - Pick1 Winner - Pick1 W Method - Pick1 W Method I wanted to keep the DB not massive though. I'm sure I'll figure it. Thanks
-
So in my DB, I have Events table, Which has Name - Fight 1 - Fight 2. . . and so on. When I enter the results back-end, would it be something like "if $userpick = $winner UPDATE $userpoints+10" Not clean code obviously, just along the lines. . Thanks again
-
I've already done what Robert suggested. I have back-end Admin, I just don't know what the best way to go about coding it so that when I enter the results of events, it adds points to whomever chose correct fighters etc. I'm not asking for code, just the best WAY.
-
Just so it's clear, I have EVERYTHING apart from what I've requested. I have homepage, Users register/login, through to main page, Then menu for Upcoming events, Fights, Fights Info, Your Picks etc. I just need the back-end coding for when users select their picks, I need to be able to (after the event) enter the results and when the results are entered and final, whomever chose the correct results, gains points. Thanks alot
-
I would imagine it's what's written inside of a Field that's inside of a Form.
-
I've created a page for the upcoming events, fights, info on fights & and a page where they can choose the outcome etc. I just need to create the part where I can enter the winner, what round & method, and with doing that, the people who predicted it correctly gain X amount of points. So I have for example. . . Anderson Silva Vs Chael Sonnen To Win: Chael Sonnen (Radio Button) Anderson SIlva (Radio Button) Method: KO (Radio Button) TKO (Radio Button) Submission (Radio Button) Decision (Radio Button) Round: 1 (Radio Button) 2 (Radio Button) 3 (Radio Button) 4 (Radio Button) 5 (Radio Button) When a user picks each of the above, it sends it to the picks in the database. I just need to create what I stated above now. (I am same person, Just managed to find my main account on here). Thanks BTW.
-
Posted wrong script, isit something to do with this? function ImageCreateFromBmp($filename) { /*** create a temp file ***/ $tmp_name = tempnam("/tmp", "GD"); /*** convert to gd ***/ if(bmp2gd($filename, $tmp_name)) { /*** create new image ***/ $img = imagecreatefromgd($tmp_name); /*** remove temp file ***/ unlink($tmp_name); /*** return the image ***/ return $img; } return false; } $bmp_img = ImageCreateFromBmp($handlework); unlink($handlework); $bmp2png = DIR_WORKING.substr($tmp_name, 0, -3).'png'; imagepng($bmp_img, $bmp2png); unset($handlework); $handlework = $bmp2png; unset($exten); $exten = 'png'; }
-
How would i use the timestamp? Or the easiest way? It's nothing major so don't want to spend too much time doing it. Code below // App define('APP_NAME', 'Hosting Mall'); // Your image hosting name define('TAG_LINE', 'Image Hosting For Everyone'); // Your tagline (for doctitles and logo) define('DESCRIPTION', 'Free Image Hosting Worldwide'); // For meta description define('KEYWORDS', 'images, photos, image hosting, photo hosting, free image hosting'); // For meta keywords // Folders /* If you change this, you also must change the folders name. */ define('DIR_UP','up/'); define('DIR_IM','x!/'); // Change this to have something like /X/filename.jpg - where "X/" is the folder name. define('DIR_WORKING',DIR_UP.'working/'); define('DIR_TEMP',DIR_UP.'temp/'); define('DIR_TH','thumbs/'); // Min-Max values -> php.ini rules the nation... $max_mb = '2'; // Max. image size (Mbytes) $max_by = $max_mb*1048576; // (bytes) $max_name = '10'; // Max. file name lenght. // Thumbs $mini_ancho = '150'; // Thumb width (pixels) $mini_alto = '150'; // Thumb height (pixels) // Resize $lowres = '16'; // Min. resize value (pixels) $higres = '1280'; // Max. resize value (pixels) // Options $lim_act = true; // true: Allows uploading just for your domain - false: Allows upload from anywhere (post from another website) $debug_mode = false; // false: Debug OFF - true: Debug ON. $cut_url = true; // true: Short URLs (TinyURL tr.im etc.) - false: normal url (http://mysite.com/images/image.jpg). $cut_url_service = 'tinyurl'; // tinyurl $cut_url_user = true; // If $cut_url = true -> true: Allows your users to cut their urls (preference) - false: Users can't choose to cut or not. $allow_over_resize = false; // true: Allows over resize images - false: Don't allow over resize.
-
Include file... Password should be $password = 'TTTTTTTTTTTT' ;
-
I have an Image Hosting website, pretty simple script, when an image is uploaded, it goes into website.com/x!/imagename.jpg. I would like to encrypt/randomize the image name at the end of the link. Anyway to do this? Thanks in advance.