-
Posts
229 -
Joined
-
Last visited
Everything posted by dzelenika
-
How to use php to send multiple emails at a time
dzelenika replied to Ashmit's topic in PHP Coding Help
you should put email command into for loop! -
How to use php to send multiple emails at a time
dzelenika replied to Ashmit's topic in PHP Coding Help
why are you waiting 5 seconds? Is your script throwing some error or doing something else? -
I'm not sure that I understand you but try to modify your echo to this echo "<td>$sent_time </td>";
-
while ($travel1 = mysql_fetch_assoc($travel2) || $x < 5) {
-
Encrypting source doesn't makes sense because user can see encrypted source. There's only possible to change music source dynamically every time user request page ...
-
could you post your code
-
$output = "30|24|17,5|4|20,15|13|33,15|22|33,9|20|22"; $string = "(" . str_replace(",", ") (", $output) . ")";
-
is there a shorter better way of doing this?
dzelenika replied to merylvingien's topic in PHP Coding Help
<p>Which of the following best describes your religion:<br> <select name="religious"> <?php $arr = array(0 => "Non religious", 1=> "Christianity", 2=> ...); foreach($arr as $key => $val) { echo '<option ' . ($key == $religious ? 'selected="selected"' : "") . 'value="' . $key . '">' . $val . '</option>' } ?> </select></p> -
Have You tried Archive_Zip PEAR PHP class?
-
what about? $rs=mysql_query("SELECT tblbusiness.*, tblsub.* FROM tblbusiness JOIN tblsub WHERE tblbusiness.category = tblsub.subsec AND tblsub.catid='$view' AND tblsub.subsec = '" . $rs["subsec"] . "'");
-
You omitted $view = $_GET["view"];
-
is this code part of a function that returns text?
-
Is Your server on Windows, linux or some other OS?
-
Finding every Nth record in a database with a non-incremental index.
dzelenika replied to stubarny's topic in MySQL Help
I droped: mysql_data_seek($result,$i); -
Where can I get familiar with, and learn, PHP Object Oriented coding?
dzelenika replied to devWhiz's topic in PHP Coding Help
Object oriented code is harder (and slower) to write and sometimes is slower executed, but is easier to maintain, reuse and debug. It is also less error prone and easier to extend and scale ... If you don't see reason to write OO code it's better to write good procedural style instead of bad OO. -
Checking if record is a value in mysql statement
dzelenika replied to jackr1909's topic in MySQL Help
I think that you should put OR in parenthesis: SELECT f.*, (SELECT id FROM posts l WHERE l.username = f.addee OR l.username = f.adder ORDER BY id DESC LIMIT $select1,1) AS maxValue FROM friends f WHERE (f.adder = '$_SESSION[username]' OR f.addee='$_SESSION[username]') AND ... -
Inserting multiple records with "unknown" number of fields?
dzelenika replied to ianh's topic in PHP Coding Help
Let's suppose that every category1 textbox is called data1[] and category1 textbox is called data2[] data receiving code should look like foreach($_REQUEST["data1"] as $value) { //do some insert } foreach($_REQUEST["data2"] as $value) { // do some insert } -
add ini_set("auto_detect_line_endings", 1); as 1st line of your script
-
fegtcsv doesn't recognize your line endings. Which is your server OS and OS of client that created CSV file?
-
if you try with: $filename = $_FILES['sel_file']['tmp_name']; $handle = fopen($filename, "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { print_r($data); mysql_query("INSERT INTO user SET id = '".$userid."', name = '".$data[0]."', email = '".$data[1]."', phone = '".$data[2]."'") or die(mysql_error()); } fclose($handle); what is the output?
-
Finding every Nth record in a database with a non-incremental index.
dzelenika replied to stubarny's topic in MySQL Help
is this what you need: <?php $total = mysql_num_rows($result); for ($i = 0; $i < $total; $i+= $total/120) { echo $row['customer_name'] . "<br />\n"; } ?> -
http://www.php.net/manual/en/pdo.prepare.php If you don't want to use PDO and you're on windows there's also excellent Microsoft's SQL Server Driver for PHP here available: http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
-
Use prepared statements, so you don't need to worry about SQL injection.
-
does your form using POST or GET?
-
I think that using MySql security is bad idea you should create user table, file table and user's group_file connection table eg; user table: id name login pass group (admin, editor, proofer, journalist ...) file table: id filename file_group table file group