Jump to content

phpinfo()

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpinfo()'s Achievements

Member

Member (2/5)

0

Reputation

  1. Awesome PFMaBiSmAd. Thank you very much! I was struggling with my database structure and just kept making things more complicated. Thanks again!!!
  2. I have a database with one row and about 50 columns, where the inserted data is being displayed on a page. But a lot of the time not all columns are being used. So say only 25 columns have data, there will be 25 blanks spaces with an &#8226; symbol. Is there a way to ignore to columns that have no data in them? Such as SELECT * from notices WHERE [columns have data] <?php $html="<table>"; $q="select * from notices"; $r=mysql_query($q); while($o=mysql_fetch_object($r)){ foreach($o as $key=>$val){ $html.="<tr><td colspan='2' bgcolor='#896B45'><div style='padding:10px;'>&#8226; {$val}<br></div></td></tr>"; }} $html.="</table>"; echo $html; ?> CREATE TABLE `notices` ( `id` int(11) NOT NULL auto_increment, `notice1` text, `notice2` text, `notice3` text, `notice4` text, `notice5` text, `notice6` text, `notice7` text, `notice8` text, `notice9` text, `notice10` text, `notice11` text, `notice12` text, `notice13` text, `notice14` text, `notice15` text, `notice16` text, `notice17` text, `notice18` text, `notice19` text, `notice20` text, `notice21` text, `notice22` text, `notice23` text, `notice24` text, `notice25` text, `notice26` text, `notice27` text, `notice28` text, `notice29` text, `notice30` text, `notice31` text, `notice32` text, `notice33` text, `notice34` text, `notice35` text, `notice36` text, `notice37` text, `notice38` text, `notice39` text, `notice40` text, `notice41` text, `notice42` text, `notice43` text, `notice44` text, `notice45` text, `notice46` text, `notice47` text, `notice48` text, `notice49` text, `notice50` text, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 I have an admin page for the posting of the date to the database: <?php include_once($_SERVER["DOCUMENT_ROOT"] . "/main.inc.php"); $page_content = db_select("select * from notices"); $pc = $page_content[0]; $ff=$_POST; if ($ff['submit']) { $insc="UPDATE notices SET notice1='".$ff['notice1']."' , notice2='".$ff['notice2']."' , notice3='".$ff['notice3']."' , notice4='".$ff['notice4']."' , notice5='".$ff['notice5']."' , notice6='".$ff['notice6']."' , notice7='".$ff['notice7']."' , notice8='".$ff['notice8']."' , notice9='".$ff['notice9']."' , notice10='".$ff['notice10']."' , notice11='".$ff['notice11']."' , notice12='".$ff['notice12']."' , notice13='".$ff['notice13']."' , notice14='".$ff['notice14']."' , notice15='".$ff['notice15']."' , notice16='".$ff['notice16']."' , notice17='".$ff['notice17']."' , notice18='".$ff['notice18']."' , notice19='".$ff['notice19']."' , notice20='".$ff['notice20']."' , notice21='".$ff['notice21']."' , notice22='".$ff['notice22']."' , notice23='".$ff['notice23']."' , notice24='".$ff['notice24']."' , notice25='".$ff['notice25']."' , notice26='".$ff['notice26']."' , notice27='".$ff['notice27']."' , notice28='".$ff['notice28']."' , notice29='".$ff['notice29']."' , notice30='".$ff['notice30']."' , notice31='".$ff['notice31']."' , notice32='".$ff['notice32']."' , notice33='".$ff['notice33']."' , notice34='".$ff['notice34']."' , notice35='".$ff['notice35']."' , notice36='".$ff['notice36']."' , notice37='".$ff['notice37']."' , notice38='".$ff['notice38']."' , notice39='".$ff['notice39']."' , notice40='".$ff['notice40']."' , notice41='".$ff['notice41']."' , notice42='".$ff['notice42']."' , notice43='".$ff['notice43']."' , notice44='".$ff['notice44']."' , notice45='".$ff['notice45']."' , notice46='".$ff['notice46']."' , notice47='".$ff['notice47']."' , notice48='".$ff['notice48']."' , notice49='".$ff['notice49']."' , notice50='".$ff['notice50']."' , id='1' WHERE id='1'"; mysql_query($insc); } ?> <html> <head> </head> <body> <form name="noticesform" method="post" action="notices_admin.php" enctype="multipart/form-data"> <textarea name='notice1' cols='110' rows='3' class='input'><?=$pc["notice1"]?> </textarea> <textarea name='notice2' cols='110' rows='3' class='input'><?=$pc["notice2"]?> </textarea> <textarea name='notice3' cols='110' rows='3' class='input'><?=$pc["notice3"]?> </textarea> <textarea name='notice4' cols='110' rows='3' class='input'><?=$pc["notice4"]?> </textarea> <textarea name='notice5' cols='110' rows='3' class='input'><?=$pc["notice5"]?> </textarea> <textarea name='notice6' cols='110' rows='3' class='input'><?=$pc["notice6"]?> </textarea> <textarea name='notice7' cols='110' rows='3' class='input'><?=$pc["notice7"]?> </textarea> <textarea name='notice8' cols='110' rows='3' class='input'><?=$pc["notice8"]?> </textarea> <textarea name='notice9' cols='110' rows='3' class='input'><?=$pc["notice9"]?> </textarea> <textarea name='notice10' cols='110' rows='3' class='input'><?=$pc["notice10"]?> </textarea> <textarea name='notice11' cols='110' rows='3' class='input'><?=$pc["notice11"]?> </textarea> <textarea name='notice12' cols='110' rows='3' class='input'><?=$pc["notice12"]?> </textarea> <textarea name='notice13' cols='110' rows='3' class='input'><?=$pc["notice13"]?> </textarea> <textarea name='notice14' cols='110' rows='3' class='input'><?=$pc["notice14"]?> </textarea> <textarea name='notice15' cols='110' rows='3' class='input'><?=$pc["notice15"]?> </textarea> <textarea name='notice16' cols='110' rows='3' class='input'><?=$pc["notice16"]?> </textarea> <textarea name='notice17' cols='110' rows='3' class='input'><?=$pc["notice17"]?> </textarea> <textarea name='notice18' cols='110' rows='3' class='input'><?=$pc["notice18"]?> </textarea> <textarea name='notice19' cols='110' rows='3' class='input'><?=$pc["notice19"]?> </textarea> <textarea name='notice20' cols='110' rows='3' class='input'><?=$pc["notice20"]?> </textarea> <textarea name='notice21' cols='110' rows='3' class='input'><?=$pc["notice21"]?> </textarea> <textarea name='notice22' cols='110' rows='3' class='input'><?=$pc["notice22"]?> </textarea> <textarea name='notice23' cols='110' rows='3' class='input'><?=$pc["notice23"]?> </textarea> <textarea name='notice24' cols='110' rows='3' class='input'><?=$pc["notice24"]?> </textarea> <textarea name='notice25' cols='110' rows='3' class='input'><?=$pc["notice25"]?> </textarea> <textarea name='notice26' cols='110' rows='3' class='input'><?=$pc["notice26"]?> </textarea> <textarea name='notice27' cols='110' rows='3' class='input'><?=$pc["notice27"]?> </textarea> <textarea name='notice28' cols='110' rows='3' class='input'><?=$pc["notice28"]?> </textarea> <textarea name='notice29' cols='110' rows='3' class='input'><?=$pc["notice29"]?> </textarea> <textarea name='notice30' cols='110' rows='3' class='input'><?=$pc["notice30"]?> </textarea> <textarea name='notice31' cols='110' rows='3' class='input'><?=$pc["notice31"]?> </textarea> <textarea name='notice32' cols='110' rows='3' class='input'><?=$pc["notice32"]?> </textarea> <textarea name='notice33' cols='110' rows='3' class='input'><?=$pc["notice33"]?> </textarea> <textarea name='notice34' cols='110' rows='3' class='input'><?=$pc["notice34"]?> </textarea> <textarea name='notice35' cols='110' rows='3' class='input'><?=$pc["notice35"]?> </textarea> <textarea name='notice36' cols='110' rows='3' class='input'><?=$pc["notice36"]?> </textarea> <textarea name='notice37' cols='110' rows='3' class='input'><?=$pc["notice37"]?> </textarea> <textarea name='notice38' cols='110' rows='3' class='input'><?=$pc["notice38"]?> </textarea> <textarea name='notice39' cols='110' rows='3' class='input'><?=$pc["notice39"]?> </textarea> <textarea name='notice40' cols='110' rows='3' class='input'><?=$pc["notice40"]?> </textarea> <textarea name='notice41' cols='110' rows='3' class='input'><?=$pc["notice41"]?> </textarea> <textarea name='notice42' cols='110' rows='3' class='input'><?=$pc["notice42"]?> </textarea> <textarea name='notice43' cols='110' rows='3' class='input'><?=$pc["notice43"]?> </textarea> <textarea name='notice44' cols='110' rows='3' class='input'><?=$pc["notice44"]?> </textarea> <textarea name='notice45' cols='110' rows='3' class='input'><?=$pc["notice45"]?> </textarea> <textarea name='notice46' cols='110' rows='3' class='input'><?=$pc["notice46"]?> </textarea> <textarea name='notice47' cols='110' rows='3' class='input'><?=$pc["notice47"]?> </textarea> <textarea name='notice48' cols='110' rows='3' class='input'><?=$pc["notice48"]?> </textarea> <textarea name='notice49' cols='110' rows='3' class='input'><?=$pc["notice49"]?> </textarea> <textarea name='notice50' cols='110' rows='3' class='input'><?=$pc["notice50"]?> </textarea> <input type="submit" name="submit" value="Click here to update" class="input"> </form> </body> </html>
  3. Figured it out. It was a PHP issue. I did yum remove php and deleted all the PHP 4 files. Then did a fresh PHP 5 ./configure install and everything works well.
  4. When I rpm -qa | grep -i '^mysql-' is shows: MySQL-devel-community-5.1.36-0.rhel4 MySQL-client-community-5.1.36-0.rhel4 MySQL-shared-community-5.1.36-0.rhel4 MySQL-server-community-5.1.36-0.rhel4 The headers and libraries are installed. I can't figure out why I am receiving the error. Is this a PHP install error? Or is it MySQL? I have tried re-installing MySQL multiple times via: rpm -qa | grep -i '^mysql-' MySQL-devel-community-5.1.36-0.rhel4 MySQL-client-community-5.1.36-0.rhel4 MySQL-shared-community-5.1.36-0.rhel4 MySQL-server-community-5.1.36-0.rhel4 rpm --nodeps -ev MySQL-shared-community-5.1.36-0.rhel4 rpm --nodeps -ev MySQL-server-community-5.1.36-0.rhel4 rpm --nodeps -ev MySQL-client-community-5.1.36-0.rhel4 rpm --nodeps -ev MySQL-devel-community-5.1.36-0.rhel4 wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-server-community-5.1.36-0.rhel4.i386.rpm/from/http://opensource.become.com/mysql/ wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-client-community-5.1.36-0.rhel4.i386.rpm/from/http://opensource.become.com/mysql/ wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-shared-community-5.1.36-0.rhel4.i386.rpm/from/http://opensource.become.com/mysql/ wget http://dev.mysql.com/get/Downloads/MySQL-5.1/MySQL-devel-community-5.1.36-0.rhel4.i386.rpm/from/http://opensource.become.com/mysql/ rpm -Uvh MySQL-server-community-5.1.36-0.rhel4.i386.rpm rpm -Uvh MySQL-client-community-5.1.36-0.rhel4.i386.rpm rpm -Uvh MySQL-shared-community-5.1.36-0.rhel4.i386.rpm rpm -Uvh MySQL-devel-community-5.1.36-0.rhel4.i386.rpm
  5. This is a new virtual server, where I have installed LAMP. When I bring up my website that is being hosted, I get this error: Warning: mysql_pconnect() [function.mysql-pconnect]: Headers and client library minor version mismatch. Headers:40120 Library:50136 in Any ideas of what has gone wrong? Thanks!
  6. Follow up: I don't think this is an issue with the rewrite rule, as it is working as far as removing the extension. But I am getting a Not Found error thereafter. Could this be an issue with the DefaultType or MIME Rewrite rule, just in case: RewriteEngine On RewriteBase / Options Indexes FollowSymLinks AllowOverride None # # Remove ".php" RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.php.*(.*)\ HTTP RewriteRule (.+)\.php.*(.*)$ $1$2 [R,L]
  7. I am switching over to a new server and I edited the httpd.conf file to be similar to my old server. I have a mod rewrite rule to remove .php extensions, which does work - but when it rewrites to http://domain.com/index I get a Not Found 404 error. Just going to http://domain.com will bring up the file, but if I try to access any files, it will rewrite and remove the extension properly, but I will get a 404 error for that file. I set DefaultType application/x-httpd-php - Not sure if this is an Apache or PHP problem.
  8. Simpler explanation. I am a user, viewing all results from a table that has an ID and content fields. I want to view the content for every id - but if in another table, an ID has exclude = Yes, don't show that one. $query = "select a.id,a.content, b.no_id, b.exclude from accounts a left outer join excludetable b on b.no_id = a.id where ((b.exclude!='Yes') order by rand() limit 10"; But if the exclude table, does not have an entry for the ID, those IDs will not show in the results. - How would you code it to show all rows from accounts, unless table exlcude b.exclude=Yes for a certain Id, then don't show that ID
  9. Basically I want to select certain tables, and show information based on the results. SELECT a.*, b.special from accounts a left outer join special_tb b on on etc. etc. WHERE a.id = $id and b.special!='Yes' So basically I want to show all results, but if the new special table has a row for a certain id that says Yes, that is excluded. --- The problem is, if the rest of the rows in the special table don't say No for every id, the results won't show up. So is there a way to say : (If b.special says Yes, exclude that from the results, but if it says NO or there is no row at all for that ID, then display the result for that ID. I don't want to have to enter thousands of "NOs" in the new table. Just exclude if there is a Yes.
  10. I have some query statements to show certain data based items selected from a DB. SELECT value FROM table WHERE value = "no" The problem is, I don't want to have to do a db insert for each id on a new table. - How would I write the SELECT code, so I can join it with other statements, where value = a userid that has No in this new table, but show all other users, even if they have yet to be entered into the table? Basically select all No's - and show all other ids whether they are in the new table or not.
  11. I have a function that dies and gives a message if there is a MySQL error: $result=mysql_query($query,$id) or die ("Unable to execute query \"".$query."\": ".mysql_error()); Is there a way to have it die and redirect to an error page instead of just giving an error message? I tried the below code, but I kept getting a too many redirects error from my browser: $error_page = header('error.php'); exit(0); $result=mysql_query($query,$id) or die ($error_page);
  12. Caesar, I have tried both methods and either continue to get the MySQL error if letters are entered for u= ; or I get a too many redirects browser error. Again, I am just trying to figure out how to get the page to exit if letters are entered for page?u= Any ideas / examples would be much appreciated. Thanks!!!
  13. How would I add this to the existing code? - Or what new codeset would I use with is_integer?
  14. I have a page that shows information based on the user id. ex. http://www.domain.com/page?u=10 The problem is, if u=letters, I get a SQL error. - Instead I would like to make it to where if someone enters u=letters, it just exits to page.php. - Basically u can only = integers. What would be the best way to do this?? - I already have it so if u= a user non-existant, it exits. But that only works for invalid numbers: $get = $_GET; $uupid = ($get['u']) ? $get['u'] : 0; if($uupid!=0) { $info1 = db_select("select user from accounts where user=$user"); if($uupid!=0 && $info1[0][0] == 0) { header("Location: page"); exit; } }
×
×
  • 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.