Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ann's Achievements


Member (2/5)



  1. I got a libphp5.so generated and php running from the command line. (It's still not running in a browser though) This is the page/code that helped me out. http://serverfault.com/questions/35696/how-do-i-reinstall-php-on-my-system # apt-get install build-essential devscripts # apt-get source php5 # cd php5-* # vim debian/rules # debuild -us -uc -b
  2. Hi sapna Did you find an answer to this issue? I have the same problem.
  3. Thanks for replying I hadn't realised #php -v and #php /var/www/html/php_info.php were also giving different versions of php! php5-cli was installed and removed with apt-get and apt-get claims it's not installed now... #apt-get remove php5-cli Reading package lists... Done Building dependency tree Reading state information... Done Package php5-cli is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. I've tried again to delete all the php files, restarted apache and when I load php_info.php in a browser PHP Version 5.2.4-2ubuntu5.10 is still running?!? but I can't use php from the command line because there's no executable. (I have check that edits to php_info.php are shown in the browser). I need to be able to get rid of PHP Version 5.2.4 or reconfigure it --with-mysql. Any suggestions? Thanks
  4. Dear All Please can someone help? I get different version of php used from the command line than I get with a browser. I've tried removing all php with 'apt-get remove' and deleted everything php that I dared like... 350 rm -rf /var/lib/php* 351 rm -rf /usr/local/bin/php* 352 rm -rf /usr/bin/php* 353 rm -rf /etc/php* 364 rm -rf /var/lib/dpkg/info/php* 369 rm -rf /usr/share/phpmyadmin 372 rm -rf /usr/share/php5 375 rm -rf /usr/share/doc/phpmyadmin 378 rm -rf /usr/share/doc/php5* 381 rm -rf /usr/local/lib/php 384 rm -rf /usr/local/include/php 387 rm -rf /usr/lib/php5 388 rm -rf /usr/bin/php 389 rm -rf /etc/cron.d/php5 429 rm -rf /usr/local/lib/php Then configured and installed php-5.3.3. From the command line I get php-5.3.3 with mysql... root# php /var/www/html/php_info.php <html> <head> </head> <body> <center>php info file</center><br><br> phpinfo() PHP Version => 5.3.3 System => Linux bicr-bioinf4 2.6.24-28-generic #1 SMP Wed May 26 23:34:09 UTC 2010 x86_64 Build Date => Aug 19 2010 12:05:17 Configure Command => './configure' '--with-mysql' <snip> but loading the same file in a browser I get 5.2.4 with no mysql... php info file PHP Logo PHP Version 5.2.4-2ubuntu5.10 System Linux bicr-bioinf4 2.6.24-28-generic #1 SMP Wed May 26 23:34:09 UTC 2010 x86_64 Build Date Jan 6 2010 21:42:59 Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php5/apache2 Loaded Configuration File (none) Scan this dir for additional .ini files /etc/php5/apache2/conf.d PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 Debug Build no Thread Safety disabled Zend Memory Manager enabled IPv6 Support enabled Registered PHP Streams zip, php, file, data, http, ftp, compress.bzip2, compress.zlib, https, ftps Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, bzip2.*, zlib.* <snip> I've stopped and started apache, closed and opened various browsers, so I know I'm looking at the right server and it's not chached. What am I missing? Many thanks root# uname -a Linux bicr-bioinf4 2.6.24-28-generic #1 SMP Wed May 26 23:34:09 UTC 2010 x86_64 GNU/Linux root# apache2 -v Server version: Apache/2.2.8 (Ubuntu) Server built: Jun 18 2010 14:04:18 root# php -v PHP 5.3.3 (cli) (built: Aug 19 2010 09:25:31) Copyright © 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright © 1998-2010 Zend Technologies
  5. Hi I've got a page with a number of dependent dropdown menus. i.e. using car manufacturer/models as an example...If the user selects 'Ford' as a manufacturer javascript reloads the page with ?manufacturer=Ford in the url and php restricts the model dropdown to models made by Ford. It works the other way too, if they select a model first the list of manufacturers is restricted. Things just got more complicated and users may select up to 3 models from the same manufacturer. If I turn the form element 'model' into an array how do I get javascript to work with it? I just need what to to with the call to the reload() function and the javascript. I can deal with php arrays. Many thanks Bits of my code for a single model... html <select name="make" onchange="reload(this.form,'select.php')" > <option value="0" selected></option> <option value="1">Ford</option> <option value="2">VW</option> <option value="4">Opal</option> </select> <select name="model" onchange="reload(this.form,'select.php')" > <option value="0" selected></option> <option value="4">fiesta</option> <option value="23">fabia</option> <option value="24">td9</option> </select> php function ddmodel(){ #model if (isset($_REQUEST['make']) and $_REQUEST['make']>0) { $mainquery="SELECT DISTINCT id,model FROM model where make=".$_REQUEST['make'] } else {$mainquery="SELECT id,model from model"; } $string= "<td><select name=\"model[".$n."]\" onchange=\"reload(this.form,'".$_SERVER['PHP_SELF']."')\" >"; $string.= "<option value=\"0\" selected></option>\n"; $ddsql_result = mysql_query($mainquery); if(mysql_num_rows($ddsql_result)){ while($ddrow = mysql_fetch_assoc($ddsql_result)){ if ($_REQUEST['model']==$ddrow['id']) { $string.= "<option value=\"".$ddrow['id']."\" selected>".$ddrow['model']."</option>\n"; } else {$string.= "<option value=\"".$ddrow['id']."\">".$ddrow['model']."</option>\n";} }} $string.= "</select></td>\n"; return $string; } function ddmake(){ #make if (isset($_REQUEST['model']) and $_REQUEST['model']>0) { $mainquery="SELECT make.make,make.id from make left join model on (make.id=model.make) where model.id=".$_REQUEST['model']; } else {$mainquery="SELECT make,id from make order by make"; } $string= "<td><select name=\"make\" onchange=\"reload(this.form,'".$_SERVER['PHP_SELF']."')\" >"; $string= "<option value=\"\"selected></option>\n"; $ddsql_result = mysql_query("$mainquery"); if(mysql_num_rows($ddsql_result)){while($ddrow = mysql_fetch_assoc($ddsql_result)){ if ($_REQUEST['make']==$ddrow['id']) { $string.= "<option value=\"".$ddrow['id']."\" selected>".$ddrow['make']."</option>\n"; } else { $string.= "<option value=\"".$ddrow['id']."\">".$ddrow['make']."</option>\n"; } }} $string.= "</select></td>\n"; return $string; } javascript function reload(form,selfid){ var str='?'; if (form.make && form.make.options[form.make.options.selectedIndex].value>0) { str +='&make=' + form.make.options[form.make.options.selectedIndex].value; } if (form.model && form.model.options[form.model.options.selectedIndex].value>0) { str +='&model=' + form.model.options[form.model.options.selectedIndex].value; } self.location=selfid + str; }
  6. I'm sure your right but the real problem was I hadn't closed the select tag. A </select> after the last </option> sorts it out. Thanks for the help.
  7. Update I can get rid of the unwanted text box by changing the line to... <div id="divXXX" style="display:none"><input type=hidden></div><!--why do I need this--> But if you know the 'proper' solution to the problem I'd be grateful for the insight. Cheers
  8. Hi, I want the contents of a text box to change with the selection from a dropdown menu. The script below works, but only if I include the line marked <!--why do I need this-->. If I delete this line the page loads without error but I get document.getElementById("divSCO0") is null when I make a selection and no changing text. How can I get the script to work without the <!--why do I need this--> line? or Can I get divXXX not to display? I've got style="display:none" but it still shows! The number of select options and divs will vary with database content. Could the java script be written before I have the results of the database query? I guess I'd have to pass it both the total number of options and which option to display? Thanks for your time. <html> <head> <script type="text/javascript"> function checker(what){ document.getElementById("divSCO0").style.display = "none"; document.getElementById("divSCO1").style.display = "none"; document.getElementById("divSCO2").style.display = "none"; if (what==1) { document.getElementById("divSCO1").style.display = "block"; }else if (what==2) { document.getElementById("divSCO2").style.display = "block"; }else { document.getElementById("divSCO0").style.display = "block"; } } </script> </head> <body> Select <select name="DDselect" onchange="checker(this.value)"><option value="0" selected></option> <option value="1">1</option> <option value="2">2</option> <br><br> <div id="divXXX" style="display:none"><textarea name="XXX" id="XXX" rows="0" cols="0"></textarea></div><!--why do I need this--> <div id="divSCO0" style="display:block"><textarea name="SCO0" id="SCO0" rows="2" cols="30"></textarea></div> <div id="divSCO1" style="display:none"><textarea name="SCO1" id="SCO1" rows="2" cols="30">Selection one from the dropdown</textarea></div> <div id="divSCO2" style="display:none"><textarea name="SCO2" id="SCO2" rows="2" cols="30">Two selected</textarea></div> </body> </html>
  9. Thanks Fenway, that's just what I'm looking for.
  10. I don't have the language to make the question obvious. I need the rows grouped on probe number and the groups ordered by the lowest pvalue in each group. The lowest pvalue in the data set is c 3 0.0001 so I want all the probe 3's first. Having used the probe 3's, the lowest pvalue in the set is now... a 1 0.001 so I want all the probe 1's next. And if I'd used "WHERE pvalue<0.08" I'd get all the probe 2's next. (Within group ordering on pvalue would be nice but it's secondary to getting the groups in the right order) I found a page in the manual about Create Procedure or Function. Maybe that's the way to go. I'll go do some reading.
  11. Thanks, I think that gives me the probe 1 group first, but I need probe 3 first because that group contains the lowest pvalue in the whole data set. If you imagine all these rows chucked in a pile I want to take from the pile the row with the lowest pvlaue, then take all the other rows with the same probe id, then from what's left take the lowest pvalue again, etc. If it's possible?
  12. Hi Can some one tell me if this is possible in a single query and if so how would I go about it? If I've got a table like... experiment probe pvalue a 1 0.001 a 2 0.7 a 3 0.01 b 1 0.7 b 2 0.7 b 3 0.0002 c 1 0.7 c 2 0.7 c 3 0.0001 and I want results like... experiment probe pvalue c 3 0.0001 b 3 0.0002 a 3 0.01 a 1 0.001 b 1 0.7 c 1 0.7 I can do this in two steps by... SELECT distinct(probe) FROM TABLE WHERE pvalue<0.05 order by pvalue; then using php to loop through the results ... SELECT * FROM TABLE WHERE probe='<each results from above query>' order by pvalue but it's very slow. I'll try and put it in words as 'I want all the rows for those probes which had a pvalue<0.05 in any experiment and I want the results grouped by probe and ordered by the lowest pvalue of each group of probes'. I can't even think of a search term that might help me solve this so any hints would be appreciated. Thanks MySQL Server version: 5.0.77
  13. Doh! I forgot to put session_start(); at the beginning of test1.php. Sorry to have bothered you.
  14. rhodesa I want to post variables from a form to 'test1.php' via your script. I thought I'd set the variables as session cookies at the start of your script but there are no session cookies when test1.php runs. It's probably the wrong approach anyway can you advise on the correct way to do this? Thanks My version of your script which reports that session cookies but test1.php doesn't <? session_start(); // Start Session session_register('analysis'); $_SESSION['analysis'] = $_REQUEST['analysis']; session_register('query'); $_SESSION['query'] = $_REQUEST['query']; ?> <html> <head> <title>Testing Javascript</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> $(function(){ //This code will run once the DOM is done loading setInterval("$('#time').load('test1.php');",1000); }); </script> </head> <body> <div id="time" style="border: 1px black solid; width: 750px;"></div> <? echo $_SESSION['analysis']." analysis<br>"; echo $_SESSION['query']." query<br>"; ?> </body> </html>
  15. Thanks Barand. Don't think I asked the question very well and I probably should have asked under php. What I was after is the array_keys function which gives an array of the column names from a query. My code now looks like... $sql = mysql_query($query); $columns= array_keys(mysql_fetch_array($sql, MYSQL_ASSOC)); $sql = mysql_query($query); while($row = mysql_fetch_array($sql, MYSQL_BOTH)){ //work out which field matched and print that field for ($i=1; $i<sizeof($row); $i++) { if (preg_match('/'.$_REQUEST['search_key'].'/', $row[$i])){ $row[$i]=preg_replace('/'.$_REQUEST['search_key'].'/', '<b>'.$_REQUEST['search_key'].'</b>', $row[$i]); #make the search term bold echo $columns[$i]." ".$row[$i]."<br>"; } } } NOTE: if you're joining tables and those tables have columns with the same name (I had edit_date columns in two tables) the array_keys function will only give you the first instance of the name so the $columns array and the $row array end up different lengths.
  • 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.