taxinomish arithmon

Σε αυτή την περιοχή μπορείτε να βρείτε ή να αναζητήσετε πληροφορίες σχετικές με την PHP

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
sometimes
Δημοσιεύσεις: 78
Εγγραφή: 21 Μάιος 2003 15:36
Επικοινωνία:

taxinomish arithmon

Δημοσίευση από sometimes » 04 Νοέμ 2005 15:52

Katarxin sygnomh gia tous latinikous xaraktires , alla dystyxos to leitourgiko tou ypologisth apo opou grafo den yposthrizei Ellhnikous xaraktires.

Exo mia podosfairikh selida kai thelo na kano to eksis : Yparxoun 16 podosfarikes omades ! Tha ithela otan tous dino apo enan arithmo ( thn bathmologia tous ) na borei na fenete se ena pinaka h bathmologia apo ton megalutero mexri ton mikrotero me thn seira .

Akoma kalutera tha htan an edina ta teleutaia apotelesmata kai ebgene h bathmologia aytomata .

Epsaksa gia kapoia scripts , alla to problima einai ori den iksera pos na zhthso kati tetoio stis mhxanes anazhthshs kai sta diafora sxetika sites .Exo ftiaksei oti allo xreizete alla exo kolisei se ayto !

Euxaristo ek ton proteron .

Άβαταρ μέλους
fafos
Script Master
Δημοσιεύσεις: 6228
Εγγραφή: 30 Νοέμ 2004 03:09

taxinomish arithmon

Δημοσίευση από fafos » 04 Νοέμ 2005 16:40

To proto einai sxetika eukolo, dhmiourgontas mia vash kai me mia forma na dineis vathmous, gkol klp.. Meta ta kaleis sthn selidas sou dynontas order by vatmoi kai DESC kai sta emfanizei symfona me tis vathmologies..

Gia to allo me ta apotelesmata na prosthetei kai tous analogous vathmous einai poio dyskolo na ginei.. alla ginete, idietera apo kapoion pou exei arketh peira se programmatismo.. An vro kairo tha to psakso..

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

taxinomish arithmon

Δημοσίευση από Rapid-eraser » 04 Νοέμ 2005 18:17

Eivai periergos o tropos pou bgevouv oi ba8mologies sto prota8lima :P idios aftes oi isoba8mies kai oi periptoseis pou simbevouv alla kai o sivipologismos twv pivwv to ka8istouv poli diskolo script gia va givei divamiko...

Fisika iparxei kai n efkoli me8odos pou eivai n proti pou skeftikes :)
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

nastis
Δημοσιεύσεις: 124
Εγγραφή: 16 Φεβ 2005 16:28
Επικοινωνία:

taxinomish arithmon

Δημοσίευση από nastis » 15 Νοέμ 2005 13:31

Αμα κάνεις χρήση mysql πάρε ένα onepager php για αυτό που θέλεις.
Εγω κρατάω + αγώνες + βαθμολογία στην βάση.
Οι υπολογισμοί γίνονται όπως θα δείς πριν καταχωρηθούν στην βάση
(νίκη 3 βαθμούς, ισοπαλία 1, ήττα 0)
μπορείς εναλλακτικά να υπολογίζεις αυτά με php κάνοντας τις πράξεις πριν βγάλεις το output

Φιλικά
Β.

Κώδικας: Επιλογή όλων

<?php

/*
filename &#58; bathmologia.php
 ----------- DB SCHEMA + SAMPLE DATA ------------------
# Table structure for table 'bathmologia'
CREATE TABLE IF NOT EXISTS bathmologia &#40;
  omada_id int&#40;3&#41; unsigned ,
  omada_name varchar&#40;255&#41; ,
  omada_agwnes tinyint&#40;3&#41; unsigned ,
  omada_nikes int&#40;3&#41; unsigned ,
  omada_iso int&#40;3&#41; unsigned ,
  omada_ites int&#40;3&#41; unsigned ,
  omada_bathmologia int&#40;3&#41; unsigned 
&#41;;

# Dumping data for table 'bathmologia'
INSERT INTO bathmologia VALUES&#40;"1","Omada 1","9","6","3","0","21"&#41;;
INSERT INTO bathmologia VALUES&#40;"2","Omada 2","9","5","3","1","18"&#41;;
INSERT INTO bathmologia VALUES&#40;"4","Omada 3","8","4","4","0","18"&#41;;
INSERT INTO bathmologia VALUES&#40;"5","Omada 4","9","4","0","5","12"&#41;;

*/



// ----------- DB INFO + CONNE ------------------
$db_host = "localhost";
$db_user = "user";
$db_pass = "pass";
$db_name = "dbname_me_bathmologia";

$connection = mysql_connect&#40;$db_host, $db_user, $db_pass&#41; or die&#40;"<div class=\"error\">There was an error connecting to the database, please try again a bit later</div>"&#41;;
mysql_select_db&#40;$db_name&#41; or die&#40;"<div class=\"error\">There was an error accessing the database, please try again a bit later</div>"&#41;;

// ----------- INVOKE ACTION IF NEEDED ------------------
if&#40;isset&#40;$_REQUEST&#91;'action'&#93;&#41;&#41;&#123;
if &#40;$_REQUEST&#91;'action'&#93;=="update_bath"&#41;&#123;
	$insert="UPDATE bathmologia SET 
	omada_name='".$_REQUEST&#91;'omada_name'&#93;."',
	omada_nikes='".$_REQUEST&#91;'omada_nikes'&#93;."',
	omada_ites='".$_REQUEST&#91;'omada_ites'&#93;."',
	omada_iso='".$_REQUEST&#91;'omada_iso'&#93;."',
	omada_agwnes='".&#40;$_REQUEST&#91;'omada_nikes'&#93;+$_REQUEST&#91;'omada_iso'&#93;+$_REQUEST&#91;'omada_ites'&#93;&#41;."',
	omada_bathmologia='".&#40;$_REQUEST&#91;'omada_nikes'&#93;*3+$_REQUEST&#91;'omada_iso'&#93;&#41;."' 
	WHERE omada_id='".$_REQUEST&#91;'omada_id'&#93;."'";
  	mysql_query&#40;$insert, $connection&#41; or die&#40;"<div class=\"error\">There was an error updating the data to the database, please try again a bit later</div>"&#41;;
&#125;
&#125;
// ----------- OUTPUT  DATA  ------------------
$query = "SELECT omada_id,omada_name,omada_agwnes,omada_nikes,omada_iso,omada_ites,omada_bathmologia FROM bathmologia order by omada_bathmologia desc";
$result = mysql_query&#40;$query, $connection&#41; or die&#40;"<div class=\"celltext\">There was an error accessing the database, please try again a bit later</div>"&#41;;
$count=0;
while &#40;list&#40;$omada_id,$omada_name,$omada_agwnes,$omada_nikes,$omada_iso,$omada_ites,$omada_bathmologia&#41; = mysql_fetch_row&#40;$result&#41;&#41;&#123;  
$count++;
echo "<form name='bath' action='bathmologia.php' method='post'>
	<input type='hidden' name='action' value='update_bath'>
	<input type='hidden' name='omada_id' value='$omada_id'>
	<tr><td>$count</td>
	<td><input type='text' name='omada_name' value='$omada_name'></td>
	<td>$omada_agwnes</td>
	<td><input type='text' name='omada_nikes' value='$omada_nikes' size='2'></td>
	<td><input type='text' name='omada_iso' value='$omada_iso' size='2'></td>
	<td><input type='text' name='omada_ites' value='$omada_ites' size='2'></td>
	<td>$omada_bathmologia</td>
	<td><input type='submit' value='Update' id='formsubmit'></td>
	</tr></form>";
&#125;
echo "</table>";	
?>

Απάντηση

Επιστροφή στο “PHP Προγραμματισμός”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες