Trebala bi mi jedna komponenta,kao ova: http://val202.rtvslo.si/sos/ (Glasbeni SOS), pa neznam gdje da tražim. Podaci su sada u .txt fajlovima, a mogu jig učitat i u sql. Tamo mi je najbitniji automatski datum u titlu (danas, danas-1, danas-2, ...)
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
function send_attachment($file, $file_is_db = true) {
global $send_to, $from, $website, $delete_backup, $html_output;
$sent = 'No';
$subject = 'MySQL backup - ' . ($file_is_db ? 'db dump' : 'report') . ' [' . $website . ']';
$boundary = md5(uniqid(time()));
$mailer = 'Sent by Backup2Mail (c) Marko Dugonjic, www.maratz.com, 2005-2009.';
$body = 'Database backup file:' . "\n" . ' - ' . $file . "\n\n";
$body .= '---' . "\n" . $mailer;
$headers = 'From: ' . $from . "\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: multipart/mixed; boundary="' . $boundary . '";' . "\n";
$headers .= 'This is a multi-part message in MIME format. ';
$headers .= 'If you are reading this, then your e-mail client probably doesn\'t support MIME.' . "\n";
$headers .= $mailer . "\n";
$headers .= '--' . $boundary . "\n";
$headers .= 'Content-Type: text/plain; charset="iso-8859-1"' . "\n";
$headers .= 'Content-Transfer-Encoding: 7bit' . "\n";
$headers .= $body . "\n";
$headers .= '--' . $boundary . "\n";
$headers .= 'Content-Disposition: attachment;' . "\n";
$headers .= 'Content-Type: Application/Octet-Stream; name="' . $file . "\"\n";
$headers .= 'Content-Transfer-Encoding: base64' . "\n\n";
$headers .= chunk_split(base64_encode(implode('', file($file)))) . "\n";
$headers .= '--' . $boundary . '--' . "\n";
if (mail($send_to, $subject, $body, $headers)) {
$sent = 'Yes';
................
...............
if (mail($send_to, $subject, $body, $headers)) {
$sent = 'Yes';
PHP Warning: mail(): Multiple or malformed newlines found in index.php on line 119
<?php
$con=mysqli_connect("localhost","erbi","erbi123","diabetmb_clani");
// preveri povezavo z bazo
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$handle = @fopen("register_za_test.csv", "r");
fgetcsv($handle);
$values='';
while (!feof($handle)) // Loop til end of file.
{
$buffer = fgets($handle, 4096); // Read a line.
list($ID, $priimek_in_ime, $naslov, $posta, $spol, $telefon, $mobitel, $datum_rojstva, $tip, $clan_je, $izkaznica, $prejem_glasila, $cl_2012, $obcina, $cl_2013, $cl_2014, $cl_2015, $cl_2016, $status)=explode(";",$buffer);//Separate string by the means of ;
//values.=($a,$b,$c);// save values and use insert query at last or
echo $ID;
$sql = "SELECT * FROM clani WHERE clani.ID = $ID";
$result = $con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "record postoji=".$ID."-<br>";
$sql = "UPDATE clani
SET ID = '$ID',
priimek_in_ime = '$priimek_in_ime',
naslov = '$naslov',
posta = '$posta',
spol = '$spol',
telefon = '$telefon',
mobitel = '$mobitel',
datum_rojstva = '$datum_rojstva',
tip = '$tip',
clan_je = '$clan_je',
izkaznica = '$izkaznica',
prejem_glasila = '$prejem_glasila',
cl_2015 = '$cl_2012',
obcina = '$obcina',
cl_2013 = '$cl_2013',
cl_2014 = '$cl_2014',
cl_2015 = '$cl_2015',
cl_2016 = '$cl_2016',
status = '$status'";
}
} else {
echo "0 results";
$result = mysqli_query($con,"insert into clani VALUES ($ID, '$priimek_in_ime', '$naslov', '$posta', '$spol', '$telefon', '$mobitel', '$datum_rojstva', '$tip', '$clan_je', '$izkaznica', '$prejem_glasila', '$cl_2012', '$obcina', '$cl_2013', '$cl_2014', '$cl_2015', '$cl_2016', '$status')");
}
}
$con->close();
?>
$result = mysqli_query($con,"select *
FROM xlpix_votes
INNER JOIN (
SELECT MAX(ip) AS lastIp, option_id, date, MAX(id) as maxId
FROM xlpix__votes
GROUP BY ip, DATE_FORMAT(DATE(xlpix_votes.date), '%Y-%m-%d')
HAVING COUNT(*) > 1
) duplicate ON duplicate.lastIp = xlpix_votes.ip
where DATE_FORMAT(DATE(xlpix_votes.date), '%Y-%m-%d') = DATE_FORMAT(DATE(duplicate.date), '%Y-%m-%d')
AND maxId > xlpix_votes.id
AND xlpix_votes.ip != 123");
Citat:
2014-09-02
1 podatak
2 podatak
3 podatak
4 podatak
2014-09-01
99 podatak
98 podatak
1 podatak
25 podatak
U izpis če tako iči:
99 podatak
98 podatak
1 podatak