litebearer
-
Posts
2,356 -
Joined
-
Last visited
Posts posted by litebearer
-
-
what error(s) are you getting when using sessions? (show the code that is failing)
-
Show us your form and your full script
-
1. what error are you receiving?
2. have you tried echoing $valuta?
-
Untested...
Put this right after $lines = file('file.txt');
$c = count($lines); if($c>30) { $lines = array_slice($lines, 0, 30); }
-
My typo...
this:
if(strlen($temp_array1[0])>10){ $value = substr($dtemp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($dtemp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];}
should be:
if(strlen($temp_array1[0])>10){ $value = substr($temp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($temp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];}
$tail will contain any text that follows your search up to 10 characters
-
1. presumes lines in file.txt terminate with \n
2. presumes $needle only appears once in a line<?php $needle = 'https:\/\/superman.com\/'; $lines = file('file.txt'); echo"<html><head><title>SEARCH RESULTS FOR: $needle</title></head><body>"; foreach($lines as $line){ if(stristr($line,$needle)){ $temp_array1 = explode($needle, $line); if(strlen($temp_array1[0])>10){ $value = substr($dtemp_array1[0], -10) . $needle; }else{ $value = $temp_array1[0] . $needle; } if(strlen($temp_array1[1])>10){ $tail = substr($dtemp_array1[1], 0, 10); }else{ $tail = $temp_array1[1];} echo "<font face='Arial'>" . $value . $tail . "</font><hr>"; } ?>
-
Look at this tutorial...
-
are you looping thru the results?
your line 66 indicates you are only 'grabing' 1 row
$row_rsVoucher = mysql_fetch_assoc($rsVoucher);
-
what have you tried?
-
ginerjm - The points are redemeenable at all S & H Green Stamp stores
OP - people usually are very hesitant to download files from strangers. it is more appropriate to use the proper code tags and display your pertinent files. ALSO make sure you have NOT listed your username/password in the posted files
-
as an illustration to Mac's response... what does $sql contain on its second iteration?
-
presuming each line in your file terminates with a return, you might look here...
-
1. check here - http://www.tizag.com/mysqlTutorial/mysqlwhere.php
2. show us what you have tried thus far, and tell us where you are experiencing the problems/errors
-
-
Perhaps...
if(isset($_POST)){ $needle = $_POST['customerId']; $new_line = $needle . "," . $_POST['name'] . "," . $_POST['email']; $lines = file("customers.csv"); $c = count($lines); $i = 0; while($i<$c) { $t_array = explode(",", $lines[$i]); if($t_array[0] == $needle) { $lines[$i] = $new_line; } $new_data = $new_data . $lines[$i] . "\n"; $i ++; } $file_handle = fopen("customers.csv", 'w'); fwrite($file_handle, $new_data); fclose($file_handle); }
-
Also look into unique constraints for your table fields - http://dev.mysql.com/doc/refman/5.0/en/create-table.html
-
hint...
$orderID = $_GET['orderID']
and so on
-
what have you done to find the problem....
1. have you tested/verified the values of your variables?
2. have you tried sending just 1 email to yourself using set values for the appropriate variables?
-
Show us your db connection sans username and password
-
$query = "SELECT * FROM " . $myusername . "-mail ORDER BY date ASC"; echo $query;
-
try echoing your query to make sure it contains what you expect it to contain
-
$query = "SELECT manager FROM tablename WHERE manager='$manager'"; echo $query; exit();
-
Did you echo your query to see if it contains what you expect it to contain?
-
Try echoing your query
how to edit,delete records from 1 common place ?
in PHP Coding Help
Posted
rough idea...
new html table column ACTION
each cell in the column will have the words EDIT DELETE
the words will link to an edit or delete script. the link will pass the ID value of the data
use GET in the edit or delete scripts. then take the appropriate action