help me pls
| From: | marthinus adi | Date: | Sun, 12 Aug 2001 06:19:00 +0000 |
| Subject: | help me pls | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11262@lists.php.net to get a copy of this message | ||
somebody help me please.....
i'm newbie in programming and PHP.
i really interesting to learn PHP, but i confused
about this:
1. what's the different between MySQL and PostgreSQL.
When i should use MySQL,
and when to use PostgreSQL, why ? ......
2. i want to upload one/more file, but the uploaded
file always store in temporary file, ex Windows/temp.
my uploaded script :
<?
if(isset($uploadedfile))
{
// 2001 is my directory for uploaded file
move_uploaded_file($uploadedfile,"2001/"); // i try
to use copy and move_uploaded, but still have the
problem
copy($uploadedfile,"/2001");
print("Local file : $uploadedfile <BR>\n");
print("Name file : $uploadedfile_name <BR>\n");
print("Size file : $uploadedfile_size <BR>\n");
print("Type file : $uploadedfile_type <BR>\n");
}
?>
<form enctype="multipart/form-data"
action="upload.php" method="post">
<input type="hidden" name="max_file_size"
value="1000">
<input name="uploadedfile" type="file">
<input type="submit" value="upload">
</form>
3. i want to make news publishing with MySQL, but i'm
still confusing...help me please
i want the news is saved by the
1.html,2.html,3.html,......
and i want to make directory for that file day by
day, month by month and year by year,
so if you want to click "more news" or "view
details" so
the URL is like this
http://www.name.com/2001/08/12/1000.html
2001 is the directory for news file in the 2001,
08 for the month, and ......
1000.html is the file name.
can somebody teach me about that.....maybe
somebody have the sample script pls ?.......
4. still about news publishing. i want i can add the
news from anywhere without any text editor,
but from the area text. how to save the news to
file, maybe in text format or html ? ...
5. how the concept to make paging, with MySQL
certainly?
this is the script from my script and i've tried
but still error
<?php
if ($page=="")
{
$page=1;
}
$y = 10; // --> record for each page...
$x=(($page-1)*$y);
$limit="$x,$y";
$sql = "select count(*) as totalrecord from TABEL
order by FIELD desc";
$result = mysql_db_query($database,$sql);
while ($hasil = mysql_fetch_array($result))
{
$hasil1 = $hasil["totalrecord"];
}
$paging=ceil($hasil1/$y);
if($page>1){
?>
<a href=LINK?page=<?echo $page-1?>>Prev</a>
<?php
}
for ($i=1;$i<=$paging;$i++)
{
if($paging>1){
?>
<a href=LINK?paging=<?echo $i?>><?echo $i?></a>
<?php
if($i<$pagingl)echo(" - ");
}
}
if($page<$paging){
?>
<a href=LINK?page=<?echo $page+1?>> Next</a></td>
<?php
}
$sql="select * from TABEL order by FIELD desc limit
$limit";
$result = mysql_db_query($database,$sql);
while ($row = mysql_fetch_array($result))
{
echo $row['SHOW FIELD'];
... etc ...
}
?>
the problem is , if i call the program ex paging.php,
the error message is undefined page variabe, but
if i call the program with ex paging.php?page=2 it's
correct.....with wrong with that paging script ?
thanks...thanks....and thanks for your answers.
::marthinusa::
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie