HanuAncutei.com - ARTA de a conversa!
Haine Dama designer roman

Bine ati venit ca musafir! ( Logare | Inregistrare )

 
Reply to this topicStart new topic
> Am Nevoie De Un, PHP-ist
rady
mesaj 6 Oct 2003, 11:10 AM
Mesaj #1


Haiduc
**

Grup: Musterii
Mesaje: 51
Inscris: 24 June 03
Forumist Nr.: 408



sa incep cu exact ce as avea nevoie:
la www.knicksonline.as.ro/0304/schedule.php am creat programul meciurilor din sezon 2003-04
am folosit urmatorul cod:
CODE
<?echo ' <div align=center><span class=headline>2003-04 Schedule</span></div><p>';
echo ' <center><table width=100% border=0 cellpading=1 cellspacing=0><tr><td bgcolor=003399 colspan=7><font color=ffffff><b>Knicks Schedule 2003-04</b></font></td></tr><tr>
<td bgcolor=ff8800 width=9%><font color=003399><b>Game</b></font></td>
<td bgcolor=ff8800 width=25%><font color=003399><div  align=center><b>Date</b></div></font></td>
<td bgcolor=ff8800 width=27%><font color=003399><b>Opponent</b></font></td>
<td bgcolor=ff8800 width=16%><font color=003399><b>Result</b></font></td>
<td bgcolor=ff8800 width=15%><font color=003399><b>Record</b></font></td>
<td bgcolor=ff8800 width=8%><font color=003399></font></td>
</tr>';

$sql = 'SELECT * FROM kol_recaps WHERE val=1 ORDER BY date';
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
echo "
<tr>
<td>".$row['id']."</td>
<td><div align=center>".$row['date']."</div></td>
<td>".$row['opponent']."</td>
<td>".$row['result']."</td>
<td>".$row['record']."</td>
<td><a href=recap.php?date=".$row['date'].">Recap</a></td>
</tr>";
}
$sql = 'SELECT * FROM kol_recaps WHERE val=0 ORDER BY date';
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
echo "
<tr><td>".$row['id']."</td><td><div align=center>".$row['date']."</div></td><td>".$row['opponent']."</td><td>".$row['result']."</td><td>".$row['record']."</td><td></td></tr>";
}


echo"</table></center>";
?>

as avea nevoie de un form prin care sa pot modifica in tabel, si sa adaug result, record, plus un articol

targetul acestui form va fi postrecap.php
CODE

<?php
include "db.php";
$date=$_POST['date'];
$opponent=$_POST['opponent'];

$query="INSERT INTO $kol_recaps (date, opponent, result, record, name_recap, recap, val)
VALUES ('$date', '$opponent', '$result', '$record', '$name_recap', '$recap', '$val')";
$result=mysql_query($query) or die (mysql_error());

mysql_close();
header("Location: addrecap.php");
?>


se pricepe cineva ? huh.gif


--------------------
X

KNICKSONLINE.COM
Go to the top of the page
 
+Quote Post
avataru
mesaj 7 Oct 2003, 08:20 PM
Mesaj #2


Musteriu
*

Grup: Musterii
Mesaje: 9
Inscris: 7 October 03
Din: www.npforums.com
Forumist Nr.: 936



te-as ajuta cu mare placere dear nu prea inteleg de ce ai nevoie. daca e legat de baza de date poti sa dai te rog un dump la structura tabelului pe care il foloseste scriptul de mai sus?

pana dai un reply o sa it dau niste sfaturi:
1. cosmetizeaza un pic codul, faci viata mai usara atat celor carora le ceri sfatul cat si tie in caz ca e de modificat ceva mai tarziu
2. cat faci echo, foloseste echo "", nu echo '' pt ca ulterior poti sa bagi '' in "", in plus, ' nu trebuie "scapate" (escaped, cu \).
3. cand ai mult cod html de bagat, poti sa iesi din php, sa scrii normal html si sa intrii din nou in php. eg.:
CODE
<html><body>
<? $foo="bar"; if ($foo) { ?>
variable foo exists
<? } else { ?>
variable foo does not exist
<? } ?>
</body></html>

4. foloseste \n ca sa arate si codul html pe caruia ii dai echo din php cat de cat bine.
5. $row['key'] poate da erori in anumite situatii... foloseste $row[key]

Sper sa te ajute smile.gif si astept un reply ca sa te pot ajuta

Acest topic a fost editat de avataru: 7 Oct 2003, 08:31 PM


--------------------
user posted image user posted image user posted image
Go to the top of the page
 
+Quote Post
(cretze)
mesaj 8 Oct 2003, 08:06 AM
Mesaj #3





Guests






... o sa incerc maine sau poimaine sa ai un exemplu ... este ok ?!? ( acum lipsa de timp liber nu-mi permite cry.gif )


Cretze ph34r.gif

Acest topic a fost editat de cretze: 8 Oct 2003, 08:07 AM
Go to the top of the page
 
+Quote Post
Promo Contextual
mesaj 8 Oct 2003, 08:06 AM
Mesaj #


ContextuALL









Go to the top of the page
 
Quote Post
(cretze)
mesaj 13 Oct 2003, 09:18 AM
Mesaj #4





Guests






... scuze de intarziere ... am fost foarte ocupat in ultima vreme ... anyway, incearca ceva in genu' asta si zi daca ai probleme ...
CODE

// start add user table
echo "\n\t\t<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0>";
echo "\n\t\t\t<FORM NAME=AddRecords ACTION=\".\\postrecap.php\" METHOD=POST>";

// add title
echo "\n\t\t\t<TR>";
echo "\n\t\t\t\t<TD COLSPAN=2 ALIGN=\"center\">Add New Record</TD>";
echo "\n\t\t\t</TR>";

// add opponent
echo "\n\t\t\t<TR>";
echo "\n\t\t\t\t<TD WIDTH=50% ALIGN=\"right\">Opponent</TD>";
echo "\n\t\t\t\t<TD WIDTH=50% ALIGN=\"left\">";
echo "\n\t\t\t\t\t<INPUT TYPE=\"text\" NAME=\"Opponent\" MAXLENGTH=255 SIZE=30>";
echo "\n\t\t\t\t</TD>";
echo "\n\t\t\t</TR>";

// add record
echo "\n\t\t\t<TR>";
echo "\n\t\t\t\t<TD WIDTH=50% ALIGN=\"right\">Record</TD>";
echo "\n\t\t\t\t<TD WIDTH=50% ALIGN=\"left\">";
echo "\n\t\t\t\t\t<INPUT NAME=\"Record\" MAXLENGTH=255 SIZE=30>";
echo "\n\t\t\t\t</TD>";
echo "\n\t\t\t</TR>";

// si in genu' asta si celelalte
// ........
// ........

// end add user table
echo "\n\t\t\t</FORM>\n";
echo "\n\t\t</TABLE>"



Cretze ph34r.gif
Go to the top of the page
 
+Quote Post
rady
mesaj 5 Nov 2003, 08:52 PM
Mesaj #5


Haiduc
**

Grup: Musterii
Mesaje: 51
Inscris: 24 June 03
Forumist Nr.: 408



Am uitat de subiect. Cretze, codul nu merge...
Vreau sa fac un form care sa-mi selecteze din tabel toate meciurile care nu s-au jucat si care au valoarea 0.
Vreau sa am un select dupa data sau id de unde sa pot selecta meciul care nu s-a disputat si sa editez linia.


--------------------
X

KNICKSONLINE.COM
Go to the top of the page
 
+Quote Post
TNT
mesaj 13 Jan 2004, 03:59 PM
Mesaj #6


Musteriu
*

Grup: Musterii
Mesaje: 4
Inscris: 17 November 03
Forumist Nr.: 1.225



Salut .
Eu ma pricepo la programare PHP si MySQL , daca imi explici exaxt pe inteles de ce ai nevoie sar putea sa te ajut . Totul depinde de cat timp am, momentat fiind in sesiune .

PA !!!
Go to the top of the page
 
+Quote Post
axel
mesaj 15 Jan 2004, 10:01 AM
Mesaj #7


Domnitor
******

Grup: Membri
Mesaje: 6.255
Inscris: 3 October 03
Forumist Nr.: 899



Bine ai venit TNT welcome.gif

Acest topic a fost editat de menthoru': 25 Mar 2004, 02:12 AM


--------------------
Azi avem.

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Versiune Text-Only Data este acum: 28 April 2024 - 02:24 AM
Ceaiuri Medicinale Haine Dama Designer Roman