7,368 Topics
| |
[CODE] pstmt = conn.prepareStatement("INSERT INTO tableA (userid, itemid) VALUES (?, ?) ON DUPLICATE KEY UPDATE value = ?"); pstmt.setString(1, userid); pstmt.setString(2, itemid); pstmt.setString(3, value); pstmt.executeUpdate(); [/CODE] This code works [CODE] pstmt = conn.prepareStatement("INSERT INTO tableA (userid, itemid) VALUES ((SELECT userid FROM user WHERE userid = ?), ?) ON DUPLICATE KEY … | |
| Hi I wonder if anyone can help I have a query SELECT b.name,c.name FROM directory_organisation_area_of_interest a, directory_organisation b, directory_areaofinterest c where b.id = a.organisation_id and a.areaofinterest_id = c.id which returns multiple rows per organisation however I would like to be able to have one row per org with multiple colums … |
i want to update the info of the highlighted row | |
delete the highlighted row ADODC DATAGRID MYSQL | |
I'm creating a forum like this one and I need to display my topics by last post. I want to create it so that the topic gets bumped back to the top whenever someone adds a new reply, like most forums including this one. I have a timestamp on both … | |
How to store both cyrillic and latin in MySQL and is there anything special that I should know to display cyrillic with PHP? (conversions etc.) Thnx in advance | |
Hi friends, My table structure as like this name | id | Roles ------------------------------- name1 | 1012 | Cleaning, Cooking name2 | 1013 | Cooking --------------------------------------------- I want to select all the repeating names ie, Want to display the name which coming more than 1 times in database. Please help … | |
I have an [B]ajax-register.php[/B] [CODE]include("connection.php"); if($_POST) { //form data $fname = mysql_real_escape_string($_POST['fname']); $lname = mysql_real_escape_string($_POST['lname']); $password = md5(mysql_real_escape_string($_POST['password'])); $confimPass = md5(mysql_real_escape_string($_POST['confirmPass'])); $email = mysql_real_escape_string($_POST['email']); $confirmEmail = mysql_real_escape_string($_POST['confirmEmail']); $dob = mysql_real_escape_string($_POST['dob']); // database $queryreg = ("INSERT INTO users (fname,lname,password,email,dob) VALUES ('$fname','$lname','$password','$email','$dob'"); mysql_query($queryreg) or die(mysql_error()); }[/CODE] Then I have my [B]register.php[/B] with … | |
I've seen over the last few days many people on the internet and various forums asking for how this is done. Now there is plenty of posts out there that explain how to do this. However I have yet to find one that explains how you work it into a … | |
I have a program for students in my school uses asp with mssql database with a small server in the school, and I want to make a website with php and mysql database, can I always update the queries by exporting the mssql to mysql? and how I can do … | |
when i try to add a record [CODE]Private Sub cmdDone_Click() Dim Rs As New ADODB.Recordset Set Rs = New ADODB.Recordset Call ServerConnect Rs.Open "SELECT * FROM list1", conn, adOpenStatic, adLockOptimistic Rs.AddNew Rs!CustomerName = txtName.Text Rs!ContactNumber = txtContact.Text Rs!Date = dt.Value Rs!TimeStart = cmbStart.Text Rs!TimeEnd = cmbEnd.Text Rs!Event = cmbEvent.Text Rs!Guest … | |
how to add record into my database mysql | |
Hi Building an e-commerce store, got a product table, with a price field got a discounts table with product_id, and an active field my query left joins discounts onto products, but I only want to pull in the discount if discount.active = '1'... but if I use 'WHERE discount.active = … | |
Hopefully someone can help me. Explaining this may be a pain for ya, but I would really appreciate any assistance that you may be able to give me. Here is my scenario. -I am trying to import a csv file into phpmyadmin. -The MySQL database is for Wordpress. -The .csv … | |
Ok what I am trying to do is submit changes. I have all the information being collected. I'm just having trouble with the proper query to run. I currently have: [CODE] $sql = "UPDATE anime_list SET anime_name = '$animename' rating = '$rating' episodes = '$episodes' WHERE id='$id'"; $result = mysqli_query($dbc, … | |
Dear Friends, I am a web designer hence i only know very little of PHP programming. I need help on the PHP script for me to post data from other server to my server. Due to my lack of knowledge in PHP so i'm using JetForm.com as a third party … | |
Hey friends, I have a page that I've been working on for HOURS and finally almost have it perfect except for TWO things: 1. Every time I load the page it automatically inserts a blank row of data into my MySQL database. (Submitting it after filling out the for works … | |
Hello I installed MYSQL and Apache via XAMPP. And I am trying some codes from a textbook while Apace and MYSQL are running. I am trying to connect MYSQL with this code :[CODE]<?php //connect to MySQL; note we’ve used our own parameters- you should use //your own for hostname, user, … | |
Hello I've large data in a table in which one of the columns is description. in this column i'm to store description of materials and their tolerance which is a (+/-)ve value. for sample:18K 1/4W ±1%. while restoring the data on a test system i observed a special character before … | |
Hi I am using the following join query to get a list of stores that have sold policies during the day. But I need it to be distinct [CODE] $Query = mysql_query("SELECT tblpolicies.StoreId , tblpolicies.DateReceived , DailyGroup.GroupName , DailyGroup.StoreName , DailyGroup.PortfolioName FROM tblpolicies LEFT OUTER JOIN (SELECT StoreId , GroupName, … | |
i am writing something in php and i keep getting the error: mysql_fetch_array not a valid sql argument. here is the code: [CODE=php] <?php if ($_GET['goto']=='requests'){ ?> <table> <?php $query = "SELECT * FROM friends WHERE toid='$id'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ $query = "SELECT * FROM members WHERE … | |
Hello, I was wondering if someone could help me. I am new to mysql/php and I was wondering if there is a way that I can have php create pages for me. What I want is that I no longer need to create new page, so I will have a … | |
I have a database, that has a type_code in it. There are 3 types of products and certain numbers and costs associated with each type. The type codes are not present in sequential order in the database. they are random and i have a csv file with only 2 columns … | |
Hi guys, Does anyone know if it's possible to connect to the MYSQL database in wamp using C#. I basically want to take information from the COM port using C# and write it to the database. Any thoughts/tutorials/links would be greatly appreciated! | |
[CODE] DELIMITER $$ DROP PROCEDURE IF EXISTS `AddTranMast` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `AddTranMast`(mDocDt date,mDocType CHAR(2)) begin declare mDocNo char(5); declare Code double; select max(docno) into Code from tranmast; if code=00000 then set mDocNo=00001; else set Code=(100000+Code+1); set mDocNo=substring(Code,2,5); end if; insert into tranmast(docno,docdt,doctype) values(mDocNo,mDocDt,mDocType); end $$ DELIMITER ; [/CODE] I … | |
Hey everybody. So I am just trying to write a script to delete a row in a MySQL database. Unfortunately I seem to have something wrong...even though I don't get any errors. Here is a snippet of the code on the page to send the request: [CODE] echo "<tr><td width='138px' … | |
Hallo daniweb!, Im new here *hehe* anyway I've been working on our companys website for a while now but I just cant get it to work... the error is @ the 26:th line. btw we're using: Cirtex hosting the defination "myusername" and "mypassword" is in the prev. .php file (main_login.php) … | |
hi, i am getting a "no database selected error" when i give the following command.. mysql>source company_data.sql ERROR 1046 (3D000):No database selected pls help me out with this error!! |
The End.