Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. add ' around $ordPhone in your query $query = "SELECT O.ordPhone, O.ordSessionID, C.cartSessionID, C.cartID, Co.coCartID FROM orders O LEFT JOIN cart C ON C.cartSessionID = O.ordSessionID LEFT JOIN cartoptions Co ON Co.coCartID = C.cartID WHERE O.ordPhone = '$ordPhone' GROUP BY O.ordPhone";
  2. <?php $addRecord->Documents[0]->name = 'a'; $doc = 'Documents'; $i = 0; $name = 'name'; echo $addRecord->{$doc}[$i]->{$name}; ?> add some { and }
  3. and line 84 is ??
  4. change INNER JOIN to LEFT JOIN
  5. on my netbook this code <?php $t = microtime(1); $test = file('tolstoy.txt');//65k lines $test = array_merge($test, $test); $test = array_merge($test, $test); $test = array_chunk($test, 1000); $name = 'part'; $i = 0; foreach ($test as $part){ $i++; $f = fopen('part'.$i.'.txt', 'w'); $part = implode("\n",$part); fwrite($f, $part); fclose($f); } echo microtime(1)-$t," $i"; ?> output 1.6787929534912 262
  6. change OR to AND
  7. you didn't connect to database you error is in 'mysqli.php'
  8. length of string $suchstring ($suchstring = substr($file, 0, 10) is 10 and in line $sucharray[] = $suchstring[10]; you tray to get 11th carather
  9. change to $query = "INSERT INTO addsellers VALUES ('','$first','$last','$business','$address','$county','$telephone','$mobile','$email','$web','$about','image1')";mysql_query($query) or trigger_error('Error in: '.$query. ' - '.mysql_error(), E_USER_ERROR); and see query
  10. error is in line $image1=$POST[image1'];
  11. try to change function to function string2array($string,&$myarray){ $lines = explode("\n",$string); foreach ($lines as $value){ $items = explode('^',$value); if (sizeof($items) == 2){ $myarray[$items[0]] = $items[1]; } else if (sizeof($items) == 3){ $myarray[$items[0]][$items[1]] = $items[2]; } else echo 'error in string2array function'; } }
  12. try to change function to function string2array($string,&$myarray){ $lines = explode("\n",$string); foreach ($lines as $value){ $items = explode("&#38;#183;",$value); if (sizeof($items) == 2){ $myarray[$items[0]] = $items[1]; } else if (sizeof($items) == 3){ $myarray[$items[0]][$items[1]] = $items[2]; } else echo 'error in string2array function'; } }
  13. change if (empty($startrow)) { $startrow=0; } to $startrow = $_GET['startrow'] ? $_GET['startrow'] : 0;
  14. look http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand On 1st page generate random seed and use it on another
  15. try to change line if ($offset > 0) continue; to if ($offset-- > 0) continue;
  16. close loop before declaration of functions
  17. try $query = "SELECT #__jt_banners.id , #__jt_banners.title , #__jt_banners.img_location , #__jt_banners.impressions , #__jt_banners.start_date , #__jt_banners.expiration_date , #__jt_banners.published , #__jt_banner_clicks.id , #__jt_banner_clicks.banner_id , COUNT(#__jt_banner_clicks.banner_id) as bann_cnt FROM #__jt_banners LEFT JOIN #__jt_banner_clicks ON (#__jt_banners.id = #__jt_banner_clicks.banner_id) GROUP BY #__jt_banners.id";
  18. change function to function select($arr){ foreach ($arr as $key => $value) { if (is_null($value)) { unset($arr[$key]); } } $last_item = end($arr); $last_item = each($arr); reset($arr); return implode(', ',$arr); }[/codeg
  19. setup $G=$start; before loop
  20. change form to <label>Item: </label> <input type="text" name="item[]" /> <label>Qty: </label> <input type="text" name="InvoiceQty[]" style="width: 20px; text-align: center;" /> <label>Price: </label> <input type="text" name="InvoicePrice[]" style="width: 50px;" value="£" /> and foreach($item as $k => $item1) { $query = "INSERT INTO invoice_items (item, quantity, price) VALUES ('$item1', '$qty[$k]', '$price[$k]')"; $query = mysql_query($query); }
  21. or <?php $sql = mysql_query("SELECT * FROM name_table"); $i = 0; while($row = mysql_fetch_array($sql)) { if ($i++ == 0) echo "<div>"; echo $row['name']; if ($i < 50){ echo ', '; } else { echo '</div>'; $i = 0; } } if ($i > 0) echo '</div>'; ?>
  22. in line $query = " SELECT ".select($arr)." FROM ".$fromdefault1.$namefrom.$fromdefault2.$fromdefault3.$numresform1.$numresform2.$audiofrom.$videofrom.$imagefrom." WHERE ".$wheredefault.$datesearch.$timesearch.$latandlongsearch . " "; you call function select it echo some strings and return null after that concat this (null) in string in next line script echo this new string
  23. try to change short php tags change '<?' to '<?php'
  24. <?php $sql = "SELECT *, UPPER(SUBSTRING(title,1,1)) AS letter FROM feudal WHERE `type` = 'Fanart' GROUP BY title, author ORDER BY title"; $query = mysql_query( $sql ) or die(mysql_error()); $ranges = range('A', 'Z'); array_unshift($ranges, '#'); while ($records = @mysql_fetch_array ($query)) { if (!in_array($records['letter'], $ranges)) $records['letter']='#'; $alpha[$records['letter']][] = $records; // ${$records['letter']}[$records['author']] = $records['title']; // $url= $records['url']; } //echo '<ul class="alphabet"> //<li><a href="#other">#</a></li>'; // Create Alpha link Listing foreach($ranges as $i) { echo (array_key_exists ($i, $alpha)) ? '<li><a href="#'.$i.'">'.$i.'</a></li>' : '<li>'.$i.'</li>'; } echo '</ul><ol class="listfanart">'; // Create Data Listing foreach($alpha as $i => $r) { // if (array_key_exists ("$i", $alpha)) { echo '<a name="'.$i.'"></a><h3>'.$i.'<div style="font-size: 10px; float: right;"><a href="#">top</a></h3>'; foreach ($r as $records) { $url = $records['url']; $key = $records['author']; $value = $records['title']; echo '<li><a href="'.$url.'" target="_blank">'.$value.'</a> by '.$key.'</li> '; } // } } ?>
  25. try echo "<td class=BorderMeRed>". "<img src=\"http://dj-info.netai.net/images/" . $row["Pic"] ."\" width=\"50\" height=\"50\" /> <br>";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.