Jump to content

JayLewis

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JayLewis's Achievements

Member

Member (2/5)

0

Reputation

  1. Yer mate, its deffo ID i need it sorting by... its starting to do my nut in!
  2. Nope, still not workin :|
  3. i want to make all the records be shown in a decending order, i've tried using: $sql = 'SELECT * FROM `repair` ORDER BY `repair` . `id` DESC'; but its not working, any help please? Heres the code: <?php $host="xxxxxx"; // Host name $username="xxxxxxx"; // Mysql username $password="xxxxx"; // Mysql password $db_name="xxxx"; // Database name $tbl_name="xxx"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); ?> <html> <head> <meta http-equiv="Content-Language" content="en-gb"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Search For A Birkenheader</title> </head> <body bgcolor="#0D3C8A"> <?php xxxx // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <html> <head> <meta http-equiv="Content-Language" content="en-gb"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Search For A Birkenheader</title> </head> <body bgcolor="#0D3C8A"> <div align="center"> <table border="1" width="752" height="172" bgcolor="#FFFFFF" bordercolorlight="#000000" bordercolordark="#000000"> <tr> <td height="144" width="742" colspan="9"> <font face="Arial" color="#FFFFFF"> <img border="0" src="banner.jpg" width="742" height="140"></font></td> </tr> <tr> <td height="20" width="13" bgcolor="#1C3867" align="center"> <p align="center"><b><font face="Arial" size="2" color="#FFFFFF">ID</font></b></td> <td height="20" width="104" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2"> Contact Name</font></b></td> <td height="20" width="113" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">Contact Number</font></b></td> <td height="20" width="70" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">Make</font></b></td> <td height="20" width="75" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">Model</font></b></td> <td height="20" width="89" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">IMEI</font></b></td> <td height="20" width="136" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">Fault</font></b></td> <td height="20" width="44" bgcolor="#1C3867" align="center"> <b><font face="Arial" color="#FFFFFF" size="2">Price</font></b></td> <td height="20" width="50" bgcolor="#1C3867" align="center"> <b><font face="Arial" size="2" color="#FFFFFF">Update</font></b></td></tr> <?php while($rows=mysql_fetch_array($result)) { ?> <tr> <td height="20" width="13" bgcolor="#1C3867" align="center"> <p align="center"><font face="Arial" size="2" color="#FFFFFF"> <a href="reciept.php?id=<? echo $rows['id']; ?>" style="text-decoration: none"> <font color="#FFFFFF"><? echo $rows['id']; ?></font></a> </font></td> <td height="20" width="104" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['name']; ?></font></td> <td height="20" width="113" bgcolor="#1C3867" align="center"> <font color="#FFFFFF" face="Arial" size="2"> <? echo $rows['number']; ?></font></td> <td height="20" width="70" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['make']; ?></font></td> <td height="20" width="75" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['model']; ?></font></td> <td height="20" width="89" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['imei']; ?></font></td> <td height="20" width="136" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['fault']; ?></font></td> <td height="20" width="44" bgcolor="#1C3867" align="center"> <font face="Arial" color="#FFFFFF" size="2"><? echo $rows['price']; ?></font></td> <td height="20" width="50" bgcolor="#1C3867" align="center"> <font face="Arial" size="2" color="#FFFFFF"> <a href="update.php?id=<? echo $rows['id']; ?>" style="text-decoration: none"> <font color="#FFFFFF">Edit</font></a></font></td></tr> <? } mysql_close(); ?>
  4. Yer, i know its easy to do. And i should be able to do it, using the $__GET[id] but its just not working for me :|
  5. I want to set up a profile for each ID.. So there is a list of sold items on a webpage with a "Reciept" link. I want to click that and it will take me to the reciept of the ID i click. So i click "Nokia 3310" and on the new page it give me all the details on another page from everything in the nokia 3310 row in the database. Thanks, Jay heres my code: <html> <head> <meta http-equiv="Content-Language" content="en-gb"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body bgcolor="#D0E0F0"> <font face="Arial" size="2"> <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000" height="52"> <tr> <td width="100%" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA" align="center"> <p align="center"> <font face="Arial" size="2"> <b>Control Panel<br> You are currently on page: "View Client List"<br> <br> Move to Pages:<br> <a href="insert.php" style="text-decoration: none"><font color="#000000">Add A Client</font></a> -</b> View Client List</font></td> </tr> <table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#3C79BD"> <tr> <td width="16" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">ID</font></td> <td width="76" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font size="2">Client Name</font></td> <td width="186" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">Address</font></td> <td width="114" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">Telephone Number</font></td> <td width="93" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">Phone/Model</font></td> <td width="171" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">Repair Comments</font></td> <td width="86" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font face="Arial" size="2">Start Date</font></td> <td width="33" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA"> <p align="center"><font size="2">Cost</font></td> <td width="58" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA" align="center"> <font size="2">Receipt </font></td> <td width="76" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#8DA3BA" align="center" valign="middle"> <font size="2">Fixed?</font></td> </tr> <?php $host="localhost"; // Host name $username="customcl_jay"; // Mysql username $password="123456"; // Mysql password $db_name="customcl_elitephones"; // Database name $tbl_name="test_mysql"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Retrieve data from database $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); // Start looping rows in mysql database. while($rows=mysql_fetch_array($result)){ ?> </font> <tr> <td width="16" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['id']; ?></font></td> <td width="76" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['name']; ?> <? echo $rows['lastname']; ?></font></td> <td width="186" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['email']; ?></font></td> <td width="114" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['tel']; ?></td> <td width="93" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['model']; ?></td> <td width="171" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['repair']; ?></td> <td width="86" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"><font face="Arial" size="2"><? echo $rows['dropoff']; ?></td> <td width="33" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"> <p align="center"><font face="Arial" size="2"><? echo $rows['price']; ?></font></td> <td width="58" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center"> <font face="Arial" size="2">Receipt</font></td> <td width="76" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#B6CCE4" align="center" valign="middle"> <form method="POST" action="--WEBBOT-SELF--"> <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --> <p><font face="Arial"> <select size="1" name="D1" style="border: 1px solid #000000; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #8DA3BA"> <option>Yes</option> <option>BER</option> <option selected>Pending</option> </select></font></p> </form> </td> </tr> <font face="Arial" size="2"> <? // close while loop } // close connection mysql_close(); ?> </font> </body> </html>
  6. post your script up. or add me on msn Jay_Lewis@Jaydiocity.co.uk
  7. i want it to work every hour like i said. but it doesnt. it just need the times sorting out, wich i cant do.
  8. Hey everyone! I've got this Lottery Script and i want it to work like this: The lottery will be every two hours... So say the lotto starts at 12 oclock, you've got till 1 oclock to buy your tickets but after that, you must wait an hour after the last lottery for the new lottery to start. Confusing Ey? Heres the code: <?php $page = 'Lottery'; $count_aantal = 0; $q1 = mysql_query("SELECT * FROM lotterij WHERE user='$this_user->id' AND name='hour'"); while($admin = mysql_fetch_object($q1)) { $count_aantal++; } $q2 = mysql_query("SELECT * FROM lot WHERE lotterij='hour'"); $win = mysql_fetch_object($q2); $count_mny = 0; $q1 = mysql_query("SELECT * FROM lotterij WHERE name='hour'"); while($admin = mysql_fetch_object($q1)) { $count_mny++; } $price = 10000; /// prijs wat de lotterij kost $mny = $count_mny * $price; /*Cron voor lotterij van elk uur*/ $q1 = mysql_query("SELECT * FROM cron WHERE name='hour'"); $day = mysql_fetch_object($q1); /*einde van cron elk uur*/ mysql_query("INSERT INTO cron (endt) VALUES($day+3600)"); /*begin post van lotterij uur*/ if(isset($_POST['submit'])) { /*checken of de users meer als 50 loten heeft,of meer als 50 wil kopen*/ if($count_aantal >=50) { Messagebox("$page","You already have more then 50 tickets."); return; } if($tickets >=51) { Messagebox("$page","You cannot buy more then 50 tickets."); return; } $geld = $price * $tickets; $geld1 = $this_user->hand - $geld; if($this_user->hand - $geld <= -1) { MessageBox("$page","You dont have enough money."); return; } /*einde check*/ // aantal $aantal= $_POST['tickets']; //$aantal keer herhalen for($i=1;$i<=$aantal;$i++){ mysql_query("INSERT INTO lotterij (id,user,tickets,name) VALUES('','$this_user->id','1','hour')"); } MessageBox("Lotery","You bought some tickets."); mysql_query("UPDATE users SET hand='$geld1' WHERE id='$this_user->id'"); return; } /*einde post*/ AddLog($this_user->id, "$this_user->username visit lottery", $tijd); echo "<table width='300' align='center'>"; echo "<form method='post' name='lotterij'>"; echo "<tr>"; echo "<th class='pic' colspan='6'>Lottery Hour</th>"; echo "</tr>"; echo "<tr>"; echo "<th class='empty' colspan='6'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Buy: <input type'text' name='tickets' maxlength='2' class='trade'> </td>"; echo "<td width='49%' class='empty'><p align='right'>Tickets $count_aantal / 50 </p></td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Ticket Cost:</td>"; echo "<td width='49%' class='empty'>".Tomoney($price)."</td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Money in Pot:</td>"; echo "<td width='49%' class='empty'>".Tomoney($mny)."</td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Start Time:</td>"; echo "<td width='49%' class='empty'>". date('D M jS, H:i:s', $day) ."</td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Buying:</td>"; echo "<td width='49%' class='empty'>". date('D M jS, H:i:s', $tijd) ."</td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Buying Time Ends:</td>"; echo "<td width='49%' class='empty'>". date('D M jS, H:i:s', $tijd+3600) ." </td>"; echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th width='1%' class='empty'> </th>"; echo "<td width='49%' class='empty'>Last Winner:</td>"; echo "<td width='49%' class='empty'>"; if($win->winner =='0') { echo "None"; } else { echo "".to_name($win->winner)."</td>"; } echo "<th width='1%' class='empty'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th class='empty' colspan='6'> </th>"; echo "</tr>"; echo "<tr>"; echo "<th class='pic' colspan='6'> <input type='submit' name='submit' class='knop' value='Buy'> </th>"; echo "</tr>"; echo "</table>"; echo "</form>"; /*einde lotterij van elk uur*/ echo "<br>"; ?>
  9. it depends on how you have set it up. I suggest using sessions instead of cookies.
  10. any ideas why its not working? thanks JayLewis x
  11. i get this error: Fatal error: Call to undefined function: makecomma() in /home/frozenf/public_html/Lottery.php on line 88 when using this on line 88: <?php echo "$".makecomma($lotto_inf->jackpot)."";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.