Gem
-
Posts
129 -
Joined
-
Last visited
Posts posted by Gem
-
-
I cant help with programming as I dont have a club ... but I do run tournaments (judo) using the double elimination system, so I might be able to help help you understand how it works ... PM me if interested
-
I found it, thank you
I dont really understand what I am looking at though .. the whole ajax thing is confusing me
I'll try and work it out
-
link doesn't work mate
-
-
OK- Clearly im stupid ... I put <php? at the beginning !! MUPPET.
Still, the error is gone, but its still not got anything in the drop down list ...
xx
-
Hi all,
Basically, what I'm trying to do it populate the drop down list with the names that are in the query (that works) but it's not happening, and I dont know why...
<php? $conn = mysql_connect("CONNECTION") or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR); if(isset($select)&&$select!=""){ $select=$_GET['select']; } ?> <html> <body> <form action="<?php echo $PHP_SELF;?>" method="get"> <select name="select"> <option value="Select"></option> <?php $list=mysql_query(" select distinct pname from pname, comp_result where comp_result.pname_id=pname.name_id ;")?> <option value="<? echo $list; ?>" </option> </select> <input type="submit" /> </form> </body> </html> <html> <body>
This is what I'm getting back:
PHP Warning: mysql_query() [function.mysql-query]: Can't connect to MySQL server on 'localhost' (10061) in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test.php on line 21 PHP Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test.php on line 21
Hope you can help, this was supposed to be the easy bit, I still got to get it to display the info I want once its been submitted ?! Grrr
Thanks
Gem
-
yeh i noticed after Maq ... sorry!
-
You beauties!!! all works properly now!!
Love u all loads x
Gem x
-
Sorry Maq ... i didnt see your post before I posted again, I changed it to what you said, and it's the same ...
-
We're getting somewhere now ... I changed
$result = mysql_query ('SELECT title, subtitle, article FROM articles WHERE id = "' . $id . '"');
to this:
$result = mysql_query ('SELECT title, subtitle, article FROM articles WHERE id = "' . $currentpage . '"');
and now I get this:
Notice: Undefined offset: 3 in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test1.php on line 10
BUT ... it is also displaying the subtitle and the article ... just not the title, and its not taking any notice of the nl2br for the article ...
Getting there though ... anyone know what that error means?
-
where to though mate??
<?php ini_set ("display_errors", "1"); error_reporting(E_ALL); // database connection info if (isset ($_GET['currentpage'])) $currentpage = $_GET['currentpage']; $conn = mysql_connect("80.94.196.33","gem","landseer") or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR); $result = mysql_query ('SELECT title, subtitle, article FROM articles WHERE id = "' . $id . '"'); while(list($id, $title, $subtitle, $article) = mysql_fetch_row($result)) { echo $title; echo "<BR />"; echo $subtitle; echo "<BR />"; echo nl2br($article); echo "<BR />"; } ?>
All i want to is get the $id from the url of the page and then use that to tell the page which article it is I want echo'd ... all seemed so easy in my head
Heres the pages, that might help
www.bradleystokejudoclub.co.uk/test.php
and then click on one of the links and that is the page above
:-\
-
well i figured that because in test.php i was linking using the $id ... I should probably use that in the query on test1.php ??
I am really stuck ... ???
Yesterday I loved PHP, today I'm hating it!
-
Thank you!!
Error:
Notice: Undefined variable: id in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test1.php on line 9
PHP Notice: Undefined variable: id in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test1.php on line 9
-
LOL - took me like a minute to see what the difference was there!
Heres what I got now... I change the query to to select where id equals $id but all i get is a blank screen ...
<?php // database connection info if (isset ($_GET['currentpage'])) $currentpage = $_GET['currentpage']; $conn = mysql_connect("80.94.196.33","gem","landseer") or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR); $result = mysql_query ('SELECT title, subtitle, article FROM articles WHERE id = "' . $id . '"'); while(list($id, $title, $subtitle, $article) = mysql_fetch_row($result)) { echo $title; echo "<BR />"; echo $subtitle; echo "<BR />"; echo nl2br($article); echo "<BR />"; } ?>
-
Thanks Rev - This is what i've got so far
Test.php (This works)
<?php $conn = mysql_connect("80.94.196.33","gem","landseer") or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR); $result = mysql_query ("SELECT id, title, subtitle, article FROM articles ORDER BY ID DESC"); while(list($id, $title, $subtitle, $article) = mysql_fetch_row($result)) { echo " <a href='test1.php?currentpage=$id'>$title</a><BR />"; echo $subtitle; echo "<BR />"; echo "<BR />"; } ?>
Test1.php (this doesnt work)
<?php // database connection info if (isset ($_GET['currentpage'])) $currentpage = $_GET('currentpage'); $conn = mysql_connect("80.94.196.33","gem","landseer") or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR); $result = mysql_query ('SELECT title, subtitle, article FROM articles WHERE title = "' . $title . '"'); while(list($title, $subtitle, $article) = mysql_fetch_row($result)) { echo $title; echo "<BR />"; echo $subtitle; echo "<BR />"; echo nl2br($article); echo "<BR />"; } ?>
Error: PHP Fatal error: Call to undefined function: array() in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test1.php on line 4
I'm getting close ... I can feel it in my bones =)
-
Sorry Rev - I just wanted to know if $id.php would work ..?
I'm going back to my other subject now.. I'll mark this one as done =(
-
Sorry
Basically:
I have a table (id, title, subtitle, article)
On test.php I have listed listed title, subtitle by id desc
title is linked as shown above
I now want to be able to open that link and see title,subtitle,article on a new page, same page ... any page??
Make sense now?? x
-
Hiya
I'm still stuck with getting my links to work ...
at the moment they look like this:
<a href='test1.php?currentpage=$id'>$title</a>
(It used to be PHP_SELF but I thought it might work if I sent it to another page altogether)
My question is ...
How do I tell 'test1.php?currentpage=$id' what to display,
or
would this be better:
<a href='$id.php'>$title</a>
Although that still leaves me not knowing how to tell THAT page what to display ... am I making sense?
Cheers
Gem
-
Sorry to bump, but im stuck without this ... x
-
Hiya
Thanks for your help. I uploaded your code, but I got this error:
PHP Parse error: syntax error, unexpected '{' in d:\webspace\bradleystokejudoclub.co.uk\wwwroot\test.php on line 4
If I remove the {} then I get "Unexpected T_VAR" which is this one: $currentpage
What to do?
X
-
??? my head hurts ...
so, when you say have it go to a new page ... do you literally mean a new page, or ..test.php?id=1 ??
that would be perfect, but I dont know how to do it.
a clue perhaps?
I really appreciate you help so much, I'm enjoying learning php and what it can do!! =)
Gem x
-
LOL sorry..
I'll try to explain
Might be easier to see for yourself though
www.bradleystokejudoclub.co.uk/test.php
On that page I have listed title and subtitle from my database....
I want to be able to click on title, and it take me to a new "page" where it shows title, subtitle, and article ...
Does that make any sense??
Thanks mate - I really appreciate your help
Gem
-
-
I kind of get what that is saying, thanks.
Does that mean I cant do it this way?
Can you suggest another way?
Thanks
Tournament Brackets (Double Elimination)?
in PHP Coding Help
Posted
1/4 final semi final Final
team 1
team 1
team 5
team 1
team 3
team 3
team 7
team 1
team 2
team 2
team 6
team 2
team 4
team 4
team 8
FIGHT FOR 3rd PLACE
team 5
team 5
team 7 team 4
team 4
team 6 Team 3
team 6
team 8 team 3
team 3
This is how to seed players ... if your not that bothered, then u can put them in randomly ... but following the numbers, any byes go in the last numbers, i.e. if you have 7 teams, them "team 8" would be a bye.
Every team gets at least two matches. Teams 3 and 4 drop down into the second round of the losers as semi finalists. This is for 8 teams, but I can go up to 64 teams.
Hope that helps a little bit xxxx
PS: Team 1 - Gold
Team 2 - Silver
Team 3 - Bronze