Jump to content

shivabharat

Members
  • Posts

    371
  • Joined

  • Last visited

    Never

Everything posted by shivabharat

  1. I am not quite clear with your 1st question 1. select (absentdays + presntdays) as total from students Now in the above query absentdays and presentdays are two fields in my table and I add them using the query. So my code will be like this while ($row = mysql_fetch_array($sql)) { echo $row[\'total\']; } The trick is I am using total as an alias name to the two colums that are added. I hope I am clear. 2. You can use the round fucntion in PHP to do this $a = round(1.967,2) Will return 1.97
  2. Try this http://www.hotscripts.com/Detailed/25779.html
  3. Have a look at this http://www.mysql.com/doc/en/Backup.html
  4. This code will delete the entries which belongs to \"123.123.com\" delete from <table-name> where remotehost=\'123.123.com\'
  5. Never mix $_SESSION and session_register() http://www.phpfreaks.com/forums/viewtopic.php?t=10842 See this link http://www.phpfreaks.com/forums/viewtopic.php?t=7632 Also there are lot of posting available about sessions have a look at them.
  6. Whats price ? here you should have used $price in your query if its being collect from another form. also when collecting values from a form you need to use the $_POST or $_GET. Enusre that you are collecting the value.
  7. Try it this way SELECT SUM(val) as xx from mydata You shouldn\'t use the quotes.
  8. I havent quite understood what you well. But you sound like using a GROUP CLAUSE in mysql . Check manual for more details. http://www.phpfreaks.com/mysqlmanual.php her is an example select fdate,SUM(goals) from <table_name> group by fdate Thsi query will display the date and the total. Dates that are same are grouped as one and only one entry is shown.
  9. Have a look at this http://www.phpfreaks.com/forums/viewtopic....1971&highlight= Next time before you post we recommend you to use the search. Thanks!
  10. Try this To see the commands list
  11. Oops!! You are right I mistook the shell as mysql prompt . Thanks for your input.
  12. Try this $query = "UPDATE fanlisting SET censor = \'n\' WHERE id = \'$uncensor\'"; mysql_query($query) or die(mysql_error()); echo $query.\'<br>\'; see if you get any error when you execute this. I have added mysql_error() which will report if there is any error.
  13. To create a dump goto command prompt c:>cd mysqlbin c:mysqlbin>mysql -u root mysql> and now in this you have to call the mysqldump command. Have a look at this link and you will know how its done http://www.mysql.com/doc/en/mysqldump.html
  14. You need to tell us more for us to help Is your site hosted in a 3rd part machine? or is that you own the system and planning to build a site? You also need to tell us about the OS you are using. :roll:
  15. Try this CREATE TABLE listings( id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY , PROPERTY_NM CHAR(15) , BEDROOM_NB TINYTEXT, MINIMUMRENT_AT TINYINT(4) , MAXIMUMRENT_AT TINYINT(4) , MINIMUMBATHROOM_NB CHAR( 1 ) , MAXIMUMBATHROOM_NB CHAR( 1 ) , MINIMUMSQUAREFEET_NB TINYINT( 4 ) , MAXIMUMSQUAREFEET_NB TINYINT( 4 ) , URL_NM CHAR( 85 ) , IMAGEURL_NM TINYTEXT , COMMENT_TX TINYTEXT, CONTACTCITY_NM TINYTEXT , CONTACTSTATE_CD TINYTEXT, CONTACTZIP_CD SMALLINT( 5 ) , COVEREDPARKING_ID TINYTEXT , GARAGEDIRECTACCESS_ID CHAR( 1 ) , GARAGEDETACHED_ID CHAR( 1 ) , ASSIGNEDPARKING_ID CHAR( 1 ) , GATEDCOMMUNITY_ID CHAR( 1 ) , ONSITEPATROL_ID CHAR( 1 ) , PLAYGROUND_ID CHAR( 1 ) , POOL_ID CHAR( 1 ) , JACUZZI_ID CHAR( 1 ) , FITNESSCENTER_ID CHAR( 1 ) , TENNISCOURT_ID CHAR( 1 ) , RACQUETBALLCOURT_ID CHAR( 1 ) , CLUBHOUSE_ID CHAR( 1 ) , BUSINESSCENTER_ID CHAR( 1 ) , LAUNDRYFACILITY_ID CHAR( 1 ) , ELEVATOR_ID CHAR( 1 ) , STORAGE_ID CHAR( 1 ) , WHEELCHAIRACCESS_ID CHAR( 1 ) , DOGSALLOWED_ID CHAR( 1 ) , CATSALLOWED_ID CHAR( 1 ) , FURNISHED_ID CHAR( 1 ) , BALCONY_ID CHAR( 1 ) , YARD_ID CHAR( 1 ) , WASHERDRYER_ID CHAR( 1 ) , WASHERDRYERHOOKUP_ID CHAR( 1 ) , INTRUSIONALARM_ID CHAR( 1 ) , AIRCONDITIONING_ID CHAR( 1 ) , CEILINGFAN_ID CHAR( 1 ) , REFRIGERATOR_ID CHAR( 1 ) , DISHWASHER_ID CHAR( 1 ) , GARBAGEDISPOSAL_ID CHAR( 1 ) , MICROWAVE_ID CHAR( 1 ) , HARDWOODFLOOR_ID CHAR( 1 ) , CARPETING_ID CHAR( 1 ) , FIREPLACE_ID CHAR( 1 ) , WALKINCLOSET_ID CHAR( 1 ) , VAULTEDCEILING_ID CHAR( 1 ) , HIGHSPEEDINTERNET_ID CHAR( 1 ) , CABLEREADY_ID CHAR( 1 ) )
  16. First you need to check if you have an user ID by this name \"\'httpd@localhost\" to check this log into mysql This will display the details and if you dont find a user by that name you need to add one,
  17. The porblem is in the query Try this $result=mysql_db_query("***",$query) or die(mysql_error()); You will get an idea what the error is.
  18. Whats the trouble? Are you looking for some one to write a code for you? :roll:
  19. Open your my.ini and add this line under [mysqld] log=C:/mysql/query_log.txt restart the mysql server after that Hope this helps!
  20. Try this <?php $sql = mysql_query("select email from table_name"); $count = mysql_num_rows($sql); $c=0; while ($row = mysql_fetch_array($sql)) { $b=$row[0]; if ( $c < ($count-1)) { $a = $a.$b.\';\'; } else { $a = $a.$b; } $c++; } echo $a; ?>
  21. Check the table \"user\" under MYSQL database . See if you have a user names \'apache\' and check if you had set any password for it. Generally passwords are encrypted and if you cant make out them you can flush them out or create new user. Check the manual for more details http://www.phpfreaks.com/mysqlmanual.php
  22. Try this $sqlread = "SELECT userid, firstname, lastname, email, phone, agency, password FROM user WHERE email = \'$lemail\' AND password = \'$lpassword\'";
  23. Taken from http://www.aspfreeserver.com/specification.asp So this means they dont Mysql and you can just create a Ms acess database locally which may be uploaded to the db folder So the Mysql and PHP marriage is pre-matured right now lol
  24. What MYSQL Says :?: So your Roll back will not be useful because you havent executed them as a transaction. If you have backed up tables try restoring them
  25. Hi, Have a look at this http://www.mysql.com/doc/en/Fulltext_Search.html the issue is because you have defined the datatype as BLOB and you cant match them using the = .
×
×
  • 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.