Need Help

Started on the old forum in September 2007 · view the original in the archive · old links redirect here

6 replies · 501 views · started 19 years ago · 1 min read

2 participants
nclemale36 Lead · 537 posts #1

hello . i need some help. am ok at adding one piece of data but when it come to a full new page am still getting errors.

i am creating a virtual lottery number page where ppl can put there own numbers in each week or woteva and other users can click on the link in the profile and see wot numbers they have got. i have managed to sort the inserting of the numbers to database . but am struggling to get the selecting bit right. my database table is called lottery with 7 columns username one two three four five six

and thats it.

heres the script am working on . can anyone help. thanks

Attachments: membersnumbers.php
nclemale36 Lead · 537 posts #3

can u post the code up uv alredi started plz, cos that link isnt workin

erm lol i clicked on it and copied it from the link but never mind . here it is

<?php header("Cache-Control: no-cache, must-revalidate"); include("config.inc.php"); header("Pragma: no-cache"); header("Content-type: text/vnd.wap.wml"); echo "<?xml version=\"1.0\"?>";

echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; echo "<wml>";

echo "<card id="card1" title="$username numbers">"; echo " "; { $sqlthing = mysql_query("SELECT * FROM lottery WHERE username='$username'"); $username=$username; $one=(mysql_result($sqlthing,0,"one")); $two=(mysql_result($sqlthing,0,"two")); $three=(mysql_result($sqlthing,0,"three")); $four=(mysql_result($sqlthing,0,"four")); $five=(mysql_result($sqlthing,0,"five")); $six=(mysql_result($sqlthing,0,"six"));

echo "my virtual lottery numbers. "; echo "one: "; printf($one); echo "two: "; printf($two); echo "three: "; printf($three); echo "four: "; printf($four); echo "five: "; printf($five); echo "six: "; printf($six);

}

?>

External image (may be gone)

<?php echo " "; echo "<a href=\"whosonline.php?username=$username&amp;session=$session\">(Who's Online)</a>"; echo " "; echo "<a href=\"welcome.php?username=$username&amp;session=$session\">(Main Menu)</a>"; echo " "; echo "</card>"; echo "</wml>"; ?>
crazybrumi Super moderator Principal · 1,064 posts #4

LOTTERY.PHP

?php 
header("Cache-Control: no-cache, must-revalidate");
include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml"); 
echo "<?xml version=\"1.0\"?>"; 
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; 
echo "<wml>"; 

echo "<card id=\"card1\" title=\"$username numbers\">"; 
echo "<p align=\"center\">";
{
$sqlthing = mysql_query("SELECT * FROM brumi_lot WHERE username='$username'");
$username=$username;
$first=(mysql_result($sqlthing,0,"first"));
$second=(mysql_result($sqlthing,0,"second"));
$third=(mysql_result($sqlthing,0,"third"));
$fourth=(mysql_result($sqlthing,0,"fourth"));
$fifth=(mysql_result($sqlthing,0,"fifth"));
$sixth=(mysql_result($sqlthing,0,"sixth"));

echo "My 6 Virtual Lottery Numbers.

";

echo "First:";
printf($first);
echo "
Second: ";
printf($second);
echo "
Third: ";
printf($third);
echo "
Fourth: ";
printf($fourth);
echo "
Fifth: ";
printf($fifth);
echo "
Sixth: ";
printf($sixth);

}

?>

[img]bar.jpg[/img]

<?php

echo "
";
echo "<a href=\"welcome.php?username=$username&session=$session\">(Main Menu)</a>";

echo "</p>"; 
echo "</card>"; 
echo "</wml>"; 
?>

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

crazybrumi Super moderator Principal · 1,064 posts #5

UPDATE LOTERRY

<?php
header("Cache-Control: no-cache, must-revalidate");
        include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
echo "<card id=\"card1\" title=\"Lottery Numbers\">";
echo "<p align=\"center\">";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and session='$session'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
        include("check.inc.php");
}
if ($ok>0)
{
        include("online.inc.php");

$result=mysql_query("select * from brumi_lot where username= '$username'");
$username=$username;
$first=(mysql_result($sqlthing,0,"first"));
$second=(mysql_result($sqlthing,0,"second"));
$third=(mysql_result($sqlthing,0,"third"));
$fourth=(mysql_result($sqlthing,0,"fourth"));
$fifth=(mysql_result($sqlthing,0,"fifth"));
$sixth=(mysql_result($sqlthing,0,"sixth"));

echo "First:";
echo "
";
echo "<input name=\"first\" value=\"$first\" maxlength=\"2\"/>";
echo "
";
echo "Second:";
echo "
";
echo "<input name=\"second\" value=\"$second\" maxlength=\"2\" />";
echo "
";
echo "Third:";
echo "
";
echo "<input name=\"third\" value=\"$third\" maxlength=\"2\" />";
echo "
";
echo "Fourth:";
echo "
";
echo "<input name=\"fourth\" value=\"$fourth\" maxlength=\"2\" />";
echo "
";
echo "Fifth:";
echo "
";
echo "<input name=\"fifth\" value=\"fifth\" maxlength=\"2\"/>";
echo "
";
echo "Sixth:";
echo "
";
echo "<input name=\"sixth\" value=\"$sixth\" maxlength=\"2\"/>";
echo "
";
echo "<a href=\"updatedlottery.php?username=$username&session=$session&first=$(first)&second=$(second)&third=$(third)&fourth=$(fourth)&fifth=$(fifth)&sixth=$(sixth)\">(Update Basic Profile)</a>";
echo "
";
echo "<a href=\"updateprofileoptions.php?username=$username&session=$session\">(Back)</a>";
echo "
";
echo "<a href=\"welcome.php?username=$username&session=$session\">(Main Menu)</a>";

}
echo "</p>";
echo "</card>"; 
echo "</wml>"; 
mysql_close();
?>

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

crazybrumi Super moderator Principal · 1,064 posts #6
<?php
header("Cache-Control: no-cache, must-revalidate");
        include("config.inc.php");
header("Pragma: no-cache");
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
echo "<wml>";
echo "<card id=\"card1\" title=\"Lottery\">";
echo "<p align=\"center\">";
$Connect = mysql_connect("$server","$user","$pass");
mysql_select_db("$dbname");
$result=mysql_query("select * from members where username='$username' and session='$session'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0)
{
        include("check.inc.php");
}
if ($ok>0)
{
        include("online.inc.php");

$result=mysql_query("select * from brumi_lot where username= '$username'");
echo "Lottery Numbers Updated";
echo "
";
echo "first:  $first
";
echo "second: $second
";
echo "third:  $third
";
echo "fourth: $fourth
";
echo "fifth:  $fifth
";
echo "sixth:  $sixth
";
$result=mysql_query("update brumi_lot set first ='$first' where username='$username'");
$result=mysql_query("update brumi_lot set second ='$second' where username='$username'");
$result=mysql_query("update brumi_lot set third ='$third ' where username='$username'");
$result=mysql_query("update brumi_lot set fourth ='$fourth' where username='$username'");
$result=mysql_query("update brumi_lot set fifth ='$fifth' where username='$username'");
$result=mysql_query("update brumi_lot set sixth ='$sixth' where username='$username'");

echo "<a href=\"updateprofileoptions.php?username=$username&session=$session\">(Update Profile Options)</a>";
echo "
";
echo "<a href=\"welcome.php?username=$username&session=$session\">(Main Menu)</a>";

}
echo "</p>";
echo "</card>"; 
echo "</wml>"; 
mysql_close();
?>

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

crazybrumi Super moderator Principal · 1,064 posts #7

just to let ya nw if ur sites isnt writtern in sessions then all u gota do is change session to password, and i avent made db thort u ad plus ent got time and ad charge ya a fiver

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close