Search found 24 matches

by mademokid
Mon Feb 18, 2008 1:23 pm
Forum: PHP - Code
Topic: Display 3 items
Replies: 3
Views: 385

Re: Display 3 items

Thanks star, it works!
by mademokid
Mon Feb 18, 2008 1:19 pm
Forum: PHP - Code
Topic: Display 3 items
Replies: 3
Views: 385

Display 3 items

I'm working on an announcements script, and I need a way where

Code: Select all

SELECT * FROM announce ORDER BY date DESC
only grabs the latest 3 announcements.

Any help appreciated!
by mademokid
Tue Aug 07, 2007 4:08 am
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

Can I use variables in the insert to database function?
by mademokid
Mon Aug 06, 2007 6:07 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

Whats this?:

Code: Select all

Warning: Cannot modify header information - headers already sent by (output started at /home/www/example.com/cj/login.php:6) in /home/www/example.com/cj/login.php on line 262
by mademokid
Mon Aug 06, 2007 5:57 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

So how could I use this in php?
by mademokid
Mon Aug 06, 2007 5:47 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

So how would I set the date field?
by mademokid
Mon Aug 06, 2007 4:57 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

I dont want the match to be displayed after that date it is on though.

And also if i use roboshanks code what format does the input have to be?
by mademokid
Mon Aug 06, 2007 3:56 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

I also need a code that deletes the match if the date has passed.
by mademokid
Mon Aug 06, 2007 3:42 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

I think i might have it! I'll tell you if it works!
by mademokid
Mon Aug 06, 2007 3:31 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

Erm... not a lot!
by mademokid
Mon Aug 06, 2007 2:59 pm
Forum: PHP - Code
Topic: PHP and mySQL
Replies: 20
Views: 1553

PHP and mySQL

I want to create a script. It has to go to my database and select all the data then display it it the date that will come first. Eg. One event on 1st augyst will be shown above one on the 2nd of august. I also need a script to add data the the database using the following fields: match_name match_da...
by mademokid
Wed Jul 11, 2007 3:39 pm
Forum: PHP - Code
Topic: PHP link
Replies: 19
Views: 1464

Had to change it a bit: <?php $query = sprintf("SELECT id FROM ibf_members WHERE name='%s'", mysql_real_escape_string($username)); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result...
by mademokid
Wed Jul 11, 2007 12:06 pm
Forum: PHP - Code
Topic: PHP link
Replies: 19
Views: 1464

Right. I have successfully generate the variable I need with this code: $query = sprintf("SELECT id FROM ibf_members WHERE name='%s'", mysql_real_escape_string($username)); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the...
by mademokid
Wed Jul 11, 2007 11:52 am
Forum: Databases
Topic: Using db query in print
Replies: 3
Views: 678

Sorted it! I used: $query = sprintf("SELECT id FROM ibf_members WHERE name='%s'", mysql_real_escape_string($username)); $result = mysql_query($query); if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } while...
by mademokid
Wed Jul 11, 2007 11:14 am
Forum: Databases
Topic: Using db query in print
Replies: 3
Views: 678

I have: $result = mysql_query("SELECT id FROM ibf_members WHERE name = ".$_COOKIE['ID_my_site'].""); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } $row = mysql_fetch_row($result); echo $row[0] The id of the user is in the same row as their name so I want t...