Search Results

Search found 14874 results on 595 pages for 'mysql connector'.

Page 125/595 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Insert or update when product is present using mysql

    - by Aryan
    main_product table productid outward shopid 333 2 44//present 343 4 44//present 353 5 44//present 363 1 44//present 373 2 44//not present min_product table productid outward shopid 333 1 44 343 1 44 353 1 44 363 1 44 SELECT DISTINCT (A.productid),A.outward, B.productid,B.outward FROM main_product A INNER JOIN min_product B on B.productid=A.product_id where A.shopid='44' and B.shopid='44' my question how can i INSERT OR UPDATE in one query using mysql by checking if it is present or not if present update else insert something like this? INSERT INTO mytable (key, value) VALUES ($newkey, $newvalue) ON DUPLICATE KEY UPDATE SET value = $newvalue

    Read the article

  • mysql for dummies

    - by kalixxx
    I just started using mysql and I just can see myself woking with strings! I mean the compiler cant catch errors like this... and its just a mess! is there a wrapper or some kind of class i can add that does something as simple as making a function that adds a table and asks for args? I'm sure there is a tool like that but i cant find it or know its name. plz help.

    Read the article

  • MySQL 5.1 Schema Installer

    - by sergiogx
    I need to make an installer for a MySQL 5.1 Database, but I'm totally a noob when it comes to installers. I've been looking at NSIS and learned a little but I don't really know how to use it to just to execute a script. Anyone out there has experience installing database schemas in multiple computers? thanks

    Read the article

  • Getting rows which include a value with MySQL

    - by sundowatch
    I have a MySQL query which gets including some vars like that: messages TABLE receiver cols user1 rows : 1,3,5 user2 rows : 2,3 user3 rows : 1,4 I want to get rows which includes '3' value. So I will get 'user1' and 'user2'. I tried that but naturally it doesn't work. mysql_query("SELECT * FROM messages WHERE receiver='3'"); How can I do this?

    Read the article

  • PHP+MySQL Update TimeStamp and get NOW() back

    - by Ben
    Is it possible to merge these two mysql queries into one? I want to get NOW() returned to a php variable. mysql_query('INSERT INTO translate (IDRef, RefType, Lang, Text, LastChangeTS) VALUES ('.$id.', \''.$reftype.'\', \''.$lang.'\', \''.$text.'\', NOW()) ON DUPLICATE KEY UPDATE text = \''.$text.'\', LastChangeTS = NOW()'); mysql_query('SELECT LastChangeTS FROM translate WHERE IDRef = '.$id.' AND RefType = \''.$reftype.'\' AND Lang = \''.$lang.'\'');

    Read the article

  • Time not entered in mysql ? Java

    - by Nitesh Panchal
    Hello, I have a datetime field in mysql table and i am using JPA for persisting data but only date goes in database. Time always shows 00:00:00. What should i do? I am not doing any manipulation with Date. All i do is to assign new Date() to a variable and store it in database. What am i doing wrong?

    Read the article

  • MySQL select/where statement

    - by expo101
    I have a webapplication linked to a mysql database with the following fields: field 1:trip_id field 2:trip_destination field 3:trip_description field 4:trip_duration In the webapplication I have a listbox based on the following: ListBox value =1: trip duration 1 - 5 days ListBox value =2: trip duration 6 - 10 days Listbox value =3: trip duration 11 -20 days ListBox value =4: trip duration over 20 days How do I put this in the sql select statement?

    Read the article

  • how to number the datas from mysql

    - by udaya
    Hi This is a doubt on mysql select query let me axplain my doubt with a simple example consider this is my query SELECT dbCountry from tableCountry tableCountry has fields dbCuntryId dbCountry and dbState I have the result as dbCountry india america england kenya pakisthan I need the result as 1 india 2 america 3 england 4 kenya 5 pakisthan the numbers 12345 must be generated with the increase in data and itis not a autoincrement id How can i get it is it something like loop

    Read the article

  • How to transfer data from MYsql server to iphone

    - by creator7
    Hi All, I created a webservice in RDB with .Net.I able to transfer data from iphone to mysql and it returns the data. But i need to transfer data from RDB to iphone whenever i need (i am strucked by the ip address of iphone which one is dynamic to connect the device from a RDB) Please tell me how i will do it otherwise tell is any other way. Thanks in Advance

    Read the article

  • Index a mysql table of 3 integer fields

    - by Doori Bar
    I have a mysql table of 3 integer fields. None of the fields have a unique value - but the three of them combined are unique. When I query this table, I only search by the first field. Which approach is recommended for indexing such table? Having a multiple-field primary key on the 3 fields, or setting an index on the first field, which is not unique? Thanks, Doori Bar

    Read the article

  • mysql query fails.It gives me invalid result

    - by user2941349
    I have to write mysql query for fetching result from my database with a specified date and code like ABH18 or ABH17 or ABH19.I write the querly like below. select * from tbl_transaction where trans_name like 'ABH19%' or trans_name like 'ABH18%' or trans_name like 'ABH17%' or trans_name like 'ABH15%' and date_of_vazhipad='2013-11-20' and trans_status='Completed successfully.' There are no result in the DB satisfying all above conditions.But i got result with different dates.But i want to ensure the date_of_vazhipad='2013-11-20' so that the query may work properly Thanks in advance

    Read the article

  • PHP and MySQL - correct way to use mysqli_real_escape_string

    - by TaG
    I was wondering if the code below is the correct way to use mysqli_real_escape_string() when storing users data in a database. Here is the PHP & MySQL code. if (mysqli_num_rows($dbc) == 0) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"INSERT INTO info (user_id, url) VALUES ('$user_id', 'mysqli_real_escape_string($url)')"); } if ($dbc == TRUE) { $dbc = mysqli_query($mysqli,"UPDATE info SET url = 'mysqli_real_escape_string($url)' WHERE user_id = '$user_id'");

    Read the article

  • MySQL greatest value in row?

    - by noryb009
    Hi! I'm using MySQL with PHP. This is like my table: (I'm using 3 values, but there are more) id | 1 | 2 | 3 1 | 3 |12 |-29 2 | 5 |8 |8 3 | 99|7 |NULL I need to get the greatest value in a certain row. If should get: (id - output) (1 - 2), (2-2), (3-1). Is there any queries for this? I've been trying, but I can't get it to work right.

    Read the article

  • I need some advice from Experts on how to develop a PHP site with MySQL

    - by mouthpiec
    Hi, I need some advice from experts :) I will develop a website using PHP and I will use also MySQL. I bought some server space from a Virtual private server including all the service needed. How should I develop the site? Shall I develop it on my machine at home (using for example Wamp), and when ready transfer all the files to the server? If so what is the best method to transfer also the database? Thanks in advance!!

    Read the article

  • Sorting MySQL table by next due date

    - by Zagga
    Hi folks, I have a MySQL table that stores (amongst other things) a persons date of birth. Is there any way to sort the table so the next due birthday is at the top? I have the date stored in standard yyyy-mm-dd DATE format and seperate year, month and day fields so I can sort it by the first birthday of the year (ORDER BY month, day) but I can't seem to get any further. Any help would be greatly appreciated. Zagga

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >