10,946 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 am writing code and i keep getting the error: mysql_fetch_array: supplied arguement is not a valid mysql resource. here is the code: [CODE] <?php include"dbconnect.php"; $item=$_POST['item']; $query3="SELECT * FROM selling WHERE name LIKE %item% AND state='$state' LIMIT 0,30"; $result3 = mysql_query($query3); while($item = mysql_fetch_array($result3)){ echo "<img src='$item[pic]' alt='pic'><a style='color: … | |
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 am trying to get a SELECT stament to work i Java. The staement has a parameter, but Eclipse gives me the following error message: You have an error in your SQL syntax, check the manual that corresponds to your MySQL version...... Is it possible to show me how … | |
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 webdevelopers, I am trying to INSERT INTO a table, a RETRIEVED gender SELECT FROM another table, but it misses a piece of code, to function: [CODE]$page_title = 'Register'; include ('./header2.html'); // Connect to the database. require_once ('./Script14.1_mysql_connect.php'); if (isset($_POST['submitted'])) { if (!empty($_POST['types']) && ($_POST['types_id']) > 1) { $g = … | |
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!! | |
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! | |
Link to the page [CODE]<a href="http://xxxx.com/u/'.$_SESSION['loginid'].'/index.php?user='.$_SESSION['loginid'].'">test</a>[/CODE] index.php [CODE]<?php if (isset($_GET['user'])){ define("HOST", "xxxx.xxxxxxx.com"); define("DBUSER", "xxxxx"); define("PASS", "xxxx"); define("DB", "xxxx"); $conn = mysql_connect(HOST, DBUSER, PASS) or die('Could not connect !<br />Please contact the site's administrator.'); $db = mysql_select_db(DB) or die('Could not connect to database !<br />Please contact the site's administrator.'); $user = … | |
Hello good ITz This is my last resort,I've checked threads but saw no answer to my question,I blieve you good people will help me out This are my existing forms, i want to add a multiple file upload system to it for each user that signs up as shown below … | |
its value not valuo can u help me with this........ | |
Hi friends, In one of my table I stored some names of students . I need to select all the names starting letter "A" or "a" .... Please help me Thanks in advance Rajeesh | |
Hello i need to match a loginid from another label in my MYSQL database. I dont know how or what i should search to get to this. | |
Okay. I have a whole list of products. Some are the same thing ie: same titles I have a form where people search for the products. I organize the products by a rank I give each product when they are first created. I want to group up the products. For … | |
Hi, I am learning store procedure. my table structure is user_id int(9) primary user_name varchar(100) user_first_name varchar(100) CREATE PROCEDURE Sp1(OUT p VARCHAR(100),OUT p1 VARCHAR(100),IN p2 INT) SELECT user_name,user_first_name INTO p,p1 FROM pm_user WHERE user_id=p2; CALL Sp1(@Name,@Fname,2); SELECT @Name,@Fname; Output comes like @Name @Fname [BLOB - 0B] [BLOB - 0B] How … | |
i have this code: [CODE]<?php session_start(); $id=$_SESSION['uid']; include "dbconnect.php"; $query = "SELECT FROM members WHERE id='$id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); ?>[/CODE] and it says mysql_fetch_array is not a valid argument. help please | |
Hello All, My problem is, i have one database and application in web server, another application in local server which is having another database . But some tables are same in database server and in my local database. I want to update these particular tables from data base server into … | |
Please can anyone explain me how I can connect a mysql database with a j2me application. I would be great full if you can give me some code samples or tutorials. thank you. | |
hi i am having a problem with a php script. i have 3 files index.php, home.html.php, form.html.php. home.html.php is working fine, if has a form that is submitting fine but when it submits i get a problem. maybe someone can help me out please i would be grateful as i … | |
How to recover data from .ibd file if innodb is corrupted I have one test database and many table with the extension of .frm and .idb file. from frm file i got strucure of database but how to restore data from individiual file of .idb file. | |
Hi friends, I had a database table as follows ... Id | Film Name | Director | Cast | ---------------------------------------- 12 | Dhoom | Name | 123,128,125,458,12 12 | Dhoom 2 | Name | 129,158,147,455 ------------------------------------------------ I need search by cast column For eg : If I select :- [ICODE]select … | |
Is there a way that if I click on a radio button, it inserts its value to database? [CODE]<form name = "data" method = "post" action = "JSP/insert.jsp"> <p> <font size = "4"> Rate: 1<input name="radio_rate" type="radio" value="1" onclick="return validate()"/> 2<input name="radio_rate" type="radio" value="2" onclick="return validate()"/> 3<input name="radio_rate" type="radio" value="3" … | |
Hi I need some help in connecting to the mysql server. Here is the full situation : server H -- i have access to this server -- but this server does not have apache it is basically like a dropbox, i just throw the phpmyadmin config file in here and … | |
I'm getting an error: mysql_fetch_array(): supplied argument is not a valid MySQL result resource [CODE] function next_record() { $this->myrow = mysql_fetch_array($this->result); return $this->myrow; } [/CODE] Please help! |
The End.