Jump to content

funbinod

Members
  • Posts

    501
  • Joined

  • Last visited

Everything posted by funbinod

  1. i asked my host. but they are still unable to find out d problem and this is still unsolved. will u please guide me (if this problem is not solved) to change d code to work under php 5.3 without mysqlnd driver?????
  2. yes! this is the only message on the page... and here is the code for classFifo.php <?php$totqty = 0;$totamt = 0;$querysss = "SELECT qty, amt FROM fifo WHERE sid=? AND cid=$cid ORDER BY date DESC";$stmt = mysqli_prepare($connect, $querysss);if (mysqli_stmt_bind_param($stmt, 'i', $sid)){ mysqli_stmt_execute($stmt) or die("Error: " . mysqli_error($connect)); $result = mysqli_stmt_get_result($stmt); while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { if ( !is_null($row['qty']) ){ if ($row['qty']>0 && $row['qty']+$totqty > $cqty){ $diff = $cqty - $totqty; $totqty = $cqty; $totamt += $diff*$row['amt']/$row['qty']; // now you must record the remain count = $row->remain-$diff } else if ($row['qty']>0) { $totqty += $row['qty']; $totamt += $row['qty']*$row['amt']/$row['qty']; // now you must record the remain=0 } } else if ($row['qty']+$totqty > $cqty){ $diff = $cqty-$totqty; $totqty = $cqty; $totamt += $diff*$row['amt']/$row['qty']; // now you must record the remain count = $row->qty-$diff } else { $totqty += $row['qty']; $totamt += $row['amt']; // now you must record the remain=0 } } if ($cqty != $totqty) { echo "error: recorded totqty={$totqty} purchased is insufficient to match cqty={$cqty}"; }} else { echo 'error: could not bind';}$totamtarr[ $sid ] = $totamt;$runSum = 0;foreach($totamtarr as $clamt) { $runSum += $clamt; $total[] = $runSum;}mysqli_stmt_close($stmt);?>
  3. ok! it displayed the msg now. it means there was some alteration on error msg setting????? did it happened because I changed the version of php????? but the msg it is displaying is the error is the same msg it was displaying before that is --- undefined function mysqli_stmt_get_result I checked the version and the mysqlnd driver in the php configuration and it said php is version 5.5.11 and mysqlnd driver is present...
  4. it should be enabled. coz I've made no changes in setting and before this there was displaying some error messages on some pages. you yourself have noticed some of them before, didn't u????
  5. the same code is working fine in my local server. its just not showing anything at my online server.
  6. I did not see mysqlnd available there. but I found an option to upgrade my php to 5.5 for public_http folder. when I did that it did not show the error but it did not return any result also....
  7. how can I know if my server has mysqlnd driver or not?????????
  8. on php 5.5.6 mysqli_stmt_get_result worked fine but on php 5.3 it says undefined function while php.net says this can be used on "PHP 5 >= PHP 5.3" why??? can there be some mistakes in my code??????
  9. wow! great! it worked. thank u for the suggestion............
  10. what I want is not suggestions about queries..... I want suggestion on changing the style of rows onMouseOver and onMouseOut. check the jquery function at the bottom
  11. I was trying to change the style of a row while I mouseover it. the rows are generated from MySQL_query and while loop. but it worked for just first row. here is what I tried--- <style>.mouseover { background-color: #CCC; color: #FCC; border:none; width:13em; height:1.5em }</style><?.................................while($row = mysqli_fetch_array($result)) { echo "<tr style='text-align:center; background-color:#c99; height:2em;' id='acrow'>"; echo "<td style='width:500px;'>" . $row['name'] . "</td>"; echo "<td style='width:125px;'>" . $row['ac_type'] . " (".$row['ac_id'].")</td>"; echo "<td style='width:200px;text-align:right'>" . number_format(($row['ob']),2,'.',',') . "</td>"; echo "<td style='width:25px;'><a href="acregister.php?aid=$row[aid]&m=e" class=slink>Edit</a></td>"; echo "<td style='width:50px;'><a href="creport.php?aid=$row[aid]" class=slink>Report</a></td>"; echo "</tr>"; }?>........................<script>$(document).ready(function(e) {//sregister $("#acrow").mouseover(function(e) { $("#acrow").addClass('mouseover'); }) $("#acrow").mouseout(function(e) { $("#acrow").removeClass('mouseover'); })})</script> please suggest me what I did mistake or there is some better option or this is not the good practice...
  12. I was trying to change the style of a row while I mouseover it. the rows are generated from MySQL_query and while loop. but it worked for just first row. here is what I tried--- <style>.mouseover { background-color: #CCC; color: #FCC; border:none; width:13em; height:1.5em }</style><?while($row = mysqli_fetch_array($result)) { echo "<tr style='text-align:center; background-color:#c99; height:2em;' id='acrow'>"; echo "<td style='width:500px;'>" . $row['name'] . "</td>"; echo "<td style='width:125px;'>" . $row['ac_type'] . " (".$row['ac_id'].")</td>"; echo "<td style='width:200px;text-align:right'>" . number_format(($row['ob']),2,'.',',') . "</td>"; echo "<td style='width:25px;'><a href="acregister.php?aid=$row[aid]&m=e" class=slink>Edit</a></td>"; echo "<td style='width:50px;'><a href="creport.php?aid=$row[aid]" class=slink>Report</a></td>"; echo "</tr>"; }?><script>$(document).ready(function(e) {//sregister $("#acrow").mouseover(function(e) { $("#acrow").addClass('mouseover'); }) $("#acrow").mouseout(function(e) { $("#acrow").removeClass('mouseover'); })})</script> please suggest me what I did mistake or there is some better option or this is not the good practice...
  13. uhhhhhh! thank u thank u! dreamweaver helped to save the file without BOM and it solved the problem
  14. encountered another problem but couldnot find out the reason... can u please help me find out the exact problem here in the following code regarding function.session_start <?phprequire_once('functions.php'); if(!$connect) { echo 'ERROR: Could not connect to the database.'; } else { if(isset($_POST['queryString'])) { $queryString = $connect->real_escape_string($_POST['queryString']); if(strlen($queryString) >0) { $query = $connect->query("SELECT name FROM account WHERE name LIKE '%$queryString%' AND cid=$cid LIMIT 10"); if($query) { echo '<h3>Registered Accounts</h3>'; while ($result = $query ->fetch_object()) { echo '<li>'.$result->name.'</li>'; } } else { echo 'Error encountered!'; } } else { } } else { echo 'you dont have permession to open this page!'; } }?> inside functions.php I've included another file named classUser.php and in that code at line 15 it has session_start() and the error messege is pointing towards this line as [source line] and the first line of the above script as [output line]....
  15. thank u for the response! I solved the problem inserting the php date() function to the database not the MySQL now() function..
  16. I think u don't know anything about anything. everyone is suggesting u and u even don't know how to implement this simple thing? u should first learn some basics from w3schools.com
  17. well! it seems to be solved now. thank u. but it stroke another problem now. there became date time problem. I used MySQL function 'now()' to update user lastActive and then calculated the time elapsed with the php date function. but it differed in execution. I think MySQL now() returned server date time and php date returned local date time. that's why each time i'm login it exceeds the max inactive time and returns logout function and redirects to login page... $laquery = mysqli_query($connect, "SELECT lastActive FROM user WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));$larow = mysqli_fetch_object($laquery);$lastActive = $larow->lastActive;$now = date('Y-m-d H:i:s');//echo strtotime($now) - strtotime($lastActive);if (strtotime($now) - strtotime($lastActive) > 1200) { mysqli_query($connect, "UPDATE user SET isloggedin='N' WHERE cid=$cid AND uid=$uid") or die("Error: ".mysqli_error($connect)); $user->logout(); $_SESSION['timeout'] = "Timeout!"; die(header("location: login.php"));} else if (strtotime($now) - strtotime($lastActive) < 1200) { mysqli_query($connect, "UPDATE user SET lastActive = now() WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));} I've assigned d default timezone date_default_timezone_set("Asia/Kathmandu"); how can I adjust this. I want to calculate the inactive time regarding server time....
  18. wherever u wish! wherever u need! since even I couldn't understand the framework u r using (as thescientist said) I cannot define exactly ur requirement. but I guess u want this here ---- <div id="image_wrap"> {if count($Product.pictures) gt 0} <a href="{$Product.pictures.0|thumbnail:'shop':null:null:false:false:true}" data-fancyindex="0"> <img src="............" style="display: inline-block; width:...px; height:...px" /> </a> {/if} </div>
  19. sorry! I think I need to submit some more lines from my code... <script language="javascript">function checkName(ob) { var invalidChars = /[^0-9"a-z.- /)(]/gi if(invalidChars.test(ob.value)) { ob.value = ob.value.replace(invalidChars,""); alert('Please use only "a-z", "0-9", ".", "-", "(", ")", """, AND "/" !'); }}</script><?php// check last active$info = "SELECT * FROM clients WHERE cid=$cid";$inforesult = mysqli_query($connect, $info) or die ("Error: " . mysqli_error($connect));$inforow = mysqli_fetch_array($inforesult);$laquery = mysqli_query($connect, "SELECT lastActive FROM user WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));$larow = mysqli_fetch_object($laquery);$lastActive = $larow->lastActive;$now = date('Y-m-d H:i:s');//echo strtotime($now) - strtotime($lastActive);if (strtotime($now) - strtotime($lastActive) > 1200) { mysqli_query($connect, "UPDATE user SET isloggedin='N' WHERE cid=$cid AND uid=$uid") or die("Error: ".mysqli_error($connect)); $user->logout(); $_SESSION['timeout'] = "Timeout!"; die(header("location: login.php"));} else if (strtotime($now) - strtotime($lastActive) < 1200) { mysqli_query($connect, "UPDATE user SET lastActive = now() WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));}?><table cellspacing="0" align="center" style="padding:0; border:none; width:1000px;">........................................................ and sorry! after some edit the line 64 is now line 67 (you can check the link again ) and there is only one line for new header at line 82. there is no header include throughout the whole script. that's why I said I didn't find line 64 (now 67)
  20. If your code is that precious that u cannot share, why do u need help? and if ur code is precious enough to keep privacy then who are others to show u their precious help?????
  21. much harassing! I couldn't find where is this line 64! on the whole header.inc.php file there is only one header included (at line 83) and this is only IF it found some CONDITION. is doing this illegal?? or i'm pointed towards elsewhere?
  22. according to the suggestions, I changed the position of include files to the top on the header.inc.php and it fixed the error regarding session_start. but still having the problem regarding header... I reviewed my code and thought it is referring me to the following portion... $laquery = mysqli_query($connect, "SELECT lastActive FROM user WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));$larow = mysqli_fetch_object($laquery);$lastActive = $larow->lastActive;$now = date('Y-m-d H:i:s');//echo strtotime($now) - strtotime($lastActive);if (strtotime($now) - strtotime($lastActive) > 1200) { mysqli_query($connect, "UPDATE user SET isloggedin='N' WHERE cid=$cid AND uid=$uid") or die("Error: ".mysqli_error($connect)); $user->logout(); $_SESSION['timeout'] = "Timeout!"; die(header("location: login.php"));} else if (strtotime($now) - strtotime($lastActive) < 1200) { mysqli_query($connect, "UPDATE user SET lastActive = now() WHERE cid=$cid AND uid=$uid") or die ("Error: ".mysqli_error($connect));} the header information on line 83 is only if some condition apply so I think this should not be a mistake. please guide me if i should not use this or suggest me anything (or this is not the problem the error message referring!!!!)
  23. or u can just put a style element inside your img tag.... like.............. <img src="..............." style="display: inline-block; width:....px; height:.....px" />
  24. you first need to learn css.... go here: http://www.w3schools.com/css/default.asp
  25. do u want to change the REAL SIZE of the image or u just want to change the DISPLAY SIZE of the image???
×
×
  • Create New...