Jump to content

suresh_kamrushi

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by suresh_kamrushi

  1. Hi, you can do it with the help of regular expression in Mysql Select * from table where cityid REGEXP '^9,|,9$|,9,' OR cityid =9
  2. What is the difference in Primary key and unique key?
  3. You can do like this SELECT * FROM tablename WHERE name IN ("name", "name2", "name3") Thanks
  4. Can any one tell me in detail about the different type joins offer by the Mysql? Thanks in Advance!!
  5. i want to know why one should use SMTP mail function instead of mail() function of PHP?
  6. Hey Fenhopi , You can try this, as still I am not sure about your table relations. If this query does not work please provide table structure with their relation so that we can map it accorindly to fetch the correct records. $GetStatus = "SELECT * FROM commentstatus, wallposts WHERE (commentstatus.status='$Naw' AND wallposts.stat='$Naw') OR (commentstatus.person='$username' AND wallposts.person='$username')";
  7. Hey you can try this, I have updated select query and if statement.
  8. Thanks Pikachu2000 Setting field as INT(6) UNSIGNED ZEROFILL is better to overcome the problem. And it is new learning for me. Thanks dude.
  9. After updating your table structure, update your table as below: update tableName set FieldName = LPAD(FieldName,6,'0'); It will work for you.
  10. Before that you need to update structure of the table. Change that field to varchar with ALTER TABLE `tableName` CHANGE `FieldName` `FieldName` VARCHAR( 10 ) NOT NULL Than you can append "0" to your values.
  11. If your first error solve than other two will be solve automatically. Please check path given in variable $file is correct. Can you provide more details about $file .
  12. Hi jarvis, You can try this. I think this will solve your problem.
  13. There is simple problem with insert query. Please write it below: It is a good practice to store all forms value in a variable and than use in different place.
  14. I have a table like below: CREATE TABLE IF NOT EXISTS `country` ( `id` int(11) NOT NULL, `state` varchar(10) collate latin1_general_ci NOT NULL, `country` varchar(50) collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; Values as under: id State Country 1 1,2,3 India State values are store in country table as commo separated. Now I want to retrieve all state in a country. And all state id should be replace by state name. Is that can achieve in one query? Thanks in Advance [attachment deleted by admin]
  15. You can try this: Insert into student (id,detail) values(5,(SELECT concat_WS(" - ",id,title,body) FROM `articles` limit 1) )
  16. i just gone through MySql manual for Fulltext and find the below code CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body)); INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('How To Use MySQL Well','After you went through a ...'), ('Optimizing MySQL','In this tutorial we will show ...'), ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'), ('MySQL vs. YourSQL','In the following database comparison ...'), ('MySQL Security','When configured properly, MySQL ...'); SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('database'); When i run the query it will give me the result. But when i run that query like : SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('datab'); i does not show me any result. Hence we can conculde that,in Fulltext search we can search complete word and not "part" of word.
  17. Hi lead_zepplin, Instead delete use following query to delete your data. and reimport your data, your data will reindex start from 1. TRUNCATE TABLE tbl_name
  18. mysql_query() returns a resource on success, or FALSE on error. Hence you can try update your code like this: if ( (mysql_query("SELECT datum FROM struktur WHERE datum='". $_POST["date"] ."'")) === FALSE)
  19. If i am not wrong you want to re arrange your ids in table. You can just export the tables and truncate the table data. Import it again in table and all your id are re arrange with new ids.
  20. Hi weejay, If you logout and login again than session ids are different. Each time user login in the site browser create a new session id.
  21. You can use customer order query "ORDER BY FIELD"
×
×
  • 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.