10,940 Topics

Member Avatar for
Member Avatar for mogaka

CASE WHEN ((SELECT COUNT(id) FROM users) > 0) THEN BEGIN INSERT INTO users(username,password) VALUES('Moshe','Ahuva'); END ELSE BEGIN INSERT INTO users(username,password) VALUES('Zvi','Idan'); END END My aim is to save with a condition. but it fails and says: "Check the manual that correponds to the right syntax near ELSE BEGIN ....". please …

Member Avatar for pritaeas
0
87
Member Avatar for riahc3

I currently have $tableName="thenameofthetable"; $someid=$_GET["someidthruget"]; $result = mysql_query("SELECT name,age FROM ". $tableName. " WHERE idp=". $someid); Which looks really insecure. How can I do it using a stored procedure which I think will make it a lot more secure? Thanks

Member Avatar for riahc3
0
639
Member Avatar for xianamersu

How to I check for existing username without using mysql in php? I tried something like this but it isnt working. Please help. Thanks. Strictly no SQL... $name=$nme; $name = file("datatext/users.txt"); $ic=file("datatext/users.txt"); if (this.$nme== $name) { echo "this user exits, please log in"; }

Member Avatar for diafol
0
342
Member Avatar for amkaos

Hi: i search as to why my database wont send out emails and find this forum. i find the exact code im using in this forum.. it originally is for xaamp. i need to have it work from my server: http://www.daniweb.com/web-development/php/threads/412468/how-to-send-mail-to-email-address-on-mysql-database. i posted on https://gist.github.com/amkaos/5608094 but i can post code …

Member Avatar for amkaos
0
387
Member Avatar for calibi.yau

Hi all I'm really hoping someone here can help me out with this one... I'm trying to search through a table via php but having difficulty with case - The problem is the data I'm searching through is encrypted (aes_encrypt) and it doesn't seem to matter what I do the …

Member Avatar for udaypatelmca
0
1K
Member Avatar for Ridji

Hi guys, I'm new here. I have a problem with connecting to my sql database. Everytime when I want to log in, I get this : Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\novi\funkcije.php on line 9 Warning: mysql_query() expects parameter 2 to be resource, boolean …

Member Avatar for Webville312
0
126
Member Avatar for SoulofchaOs

There's a error when I run this jsp file --> **" pstmt.executeUpdate();".** **"org.apache.jasper.JasperException: An exception occurred processing JSP page /TestAdd.jsp at line 39"** My code essentially have a text box for users to enter a value, and then the value is sent to the MySQL database. Any help is appreciated …

Member Avatar for peter_budo
0
303
Member Avatar for andika.kurniawan.121

There are two tables "LESSON" TABLE Attributes : - id_lesson -lesson_name - semester "LECTURES" TABLE Attributes : - id_lectures - id_lesson - id_lecturer - hour - day How to display all atributes in lectures table where lessons in 2nd semester ? Note : there's id_lesson in lectures table

Member Avatar for TonyG_cyprus
0
141
Member Avatar for kakalahori

ok here is the login function from my class user which parent class is a Db connection file <?php require_once("DBConnection.php"); class User extends DBConnection { .... .... ... ... public function Login() { $sqlSelect = "select `UserName` from `user` where `UserName` = '$this->userName' and `Password` = '$this->password'"; $result = @mysql_query($sqlSelect, …

Member Avatar for diafol
0
216
Member Avatar for RoryGren

Hi All I'm sure I'm missing something very small - and embarrassing! I'm being lazy - I could have entered the data manually, but wanted to automate it. I have a small csv file containing swimming meets, dates and locations along the following lines: May-13;;;; 17;other;Level 1 Program 1;Arboretum; 24;other;All …

Member Avatar for RoryGren
0
245
Member Avatar for geneh23

Hey everyone, So I did some more searching and I found a link that sort of helped me figure this thing out in a sense.. Here's the link https://developers.google.com/maps/articles/phpsqlajax_v3 . When I do all of what the site told me to do, it did give me a map but it …

Member Avatar for geneh23
0
368
Member Avatar for JACOBKELL

I need to convert mysql class of one script to make a support for sqlite,but problem is sqlite dont have username/password thing nor database select as well,which means how some parts need to be removed.If i would convert to mssql one search and replace probaly would do the job.There is …

Member Avatar for cereal
0
239
Member Avatar for Victoryy

I am using MySql 5.1. I want to create a dump file through command prompt. I am using the MySQL Command Line Client. I have searched on web and got a command as. `mysql -u username -p password -h host database_name > dumpfile.sql` While executing it in my client command …

Member Avatar for cereal
0
236
Member Avatar for Tinnin

Hi all, I have the following query: SELECT A.Name, MAX(B.VisitDate) AS 'Last Visit Date', A.Active FROM B INNER JOIN A ON B.NameCodeB = A.NameCodeA GROUP BY B.NameCodeB HAVING MAX(B.VisitDate) < DATE_SUB(CURDATE(),INTERVAL 2 MONTH) AND A.Active = 1 This selects a list of all people in the database who last visited …

Member Avatar for Tinnin
0
197
Member Avatar for mpc123

Hi Im trying to get mysql_query result with foreach set up and i am just planning what i am going to do but I am stuck with adding foreach into my code so far. Basically F field has several different options which are duplicated lots of times, so i need …

Member Avatar for mpc123
0
256
Member Avatar for sathishnadu

Can anyone explain me on details the difference of Deadlock and Lockwait errors found on MySQL 5.1. Is it just the same? When did the deadlock error occur and when did the lockwait timeout occur?

Member Avatar for pritaeas
0
60
Member Avatar for RigaConnectCom

This is working code $sql = "REPLACE INTO 2_1_journal (Number,RecordDay, RecordMonth) VALUES "; $insertQuery = array(); $insertData = array(); foreach ($_POST['row_id'] as $i => $row_id) { $insertQuery[] = '(?, ?, ?)'; $insertData[] = $row_id; $insertData[] = $_POST['date_day'][$i]; $insertData[] = $_POST['date_month'][$i]; } if (!empty($insertQuery)) { $sql .= implode(', ', $insertQuery); $stmt …

Member Avatar for RigaConnectCom
0
1K
Member Avatar for mogaka

SELECT code_type,code,encounter,pid,provider_id,date,CONCAT('code_tye',':','code') INTO @code_type,@code,@encounter,@pid,@povider_id,@date,@standard_code FROM billing FOR EACH ROW BEGIN SELECT procedure_type_id INTO @type_id FROM procedure_type WHERE standard_code='@standard_code' FOR EACH ROW BEGIN INSERT INTO procedure_order(procedure_type_id,date_ordered,provider_id,date_collected,order_priority,order_status ,patient_instructions,patient_id,encounter_id) VALUES('@type_id','@date','@provider_id','@date','high','pending','complaints','@pid','@encounter') END END #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for …

Member Avatar for pritaeas
0
211
Member Avatar for baruchM

I have tested out my procedure on my home machine. It woks pretty well I know there is output from the sql. Now I want to try it out on the host. It gives no output. Here is my php code $bob="call seeker($profound)"; if (mysqli_multi_query($conn,$bob)) { echo "<hr>"; echo "<table><th>Section</th><th>Author</th><th>Title</th>"; …

Member Avatar for pritaeas
0
272
Member Avatar for SQLpower

Hello guys, Long story short, when I register a user on my website, it enters for every single column value 0. It should be due to the fact that's not picking up the data from my registration page? Although, it should be ok as I am only picking up the …

Member Avatar for SQLpower
0
192
Member Avatar for Ronnie.Sk1ttl3s.Eke

I am getting this error when inserting a query into the SQL tab of a database, it only adds 2 tables when it is supposed to add more, but the error is stopping it? Screenshot: http://gyazo.com/b62b31137708228beb791ed6c8ad01ea Query im inserting: http://pastebin.com/rMJeA0Xb Software: MySQL Software version: 5.1.68-cll - MySQL Community Server (GPL) …

Member Avatar for JOSheaIV
0
250
Member Avatar for mbarandao

Good day all: I'm trying to create a graph using data from mysql on the jpgraph platform. I've been experiencing difficulties with an error 15009 and cannot seem to address the error --lots of reading on the net concerning this error has yield nothing. I'm hoping that someone here is …

Member Avatar for pritaeas
0
1K
Member Avatar for grant.baker

I'm trying to sum all numeric fields individually. I won't always know the field names, otherwise I could manually construct the query `SELECT SUM(Field1) as Field1, SUM(Field2) as Field2...etc FROM myTable` Is there a way to construct this on the fly in mysql? I'm thinking there's probably a way to …

Member Avatar for grant.baker
0
244
Member Avatar for mohnish34

Hello all, i am developing a friend request type feature ion my site using php. So can ypu please advice me on how the database design should be there? Thank you

Member Avatar for pritaeas
0
64
Member Avatar for adeeb.keyaam

<?php $dbHost = "localhost"; $dbUser = "root"; $dbPass = ""; $dbName = "test"; $conn = mysql_connect($dbHost, $dbUser, $dbPass); if(!$conn){ die(mysql_error()); } mysql_select_db($dbName, $conn) or die(mysql_error()); if(isset($_POST['submit'])){ $field = $_POST['field']; } if(isset($_POST['submit2'])){ $field2 = $_POST['field2']; } if(isset($_POST['submit3'])){ $field3 = $_POST['field3']; } ?> <?php if(!isset($_POST['submit']) || isset($_POST['submit']) != "true"){ ?> <form id="create" …

Member Avatar for adeeb.keyaam
0
214
Member Avatar for sathishnadu

Should store procedure cached in Mysql? If yes, How long it is stay in cache? In my case, When I call one store procedure first time, It is giving me result in 1sec, after that it gives me result in 400ms. and when I am changing some parameters passed to …

Member Avatar for cereal
0
174
Member Avatar for sathishnadu

I have a query: SELECT b.user_id, b.active FROM users b WHERE b.followers_count != (SELECT COUNT(*) FROM (SELECT u.user_id FROM user_follow uf,users u,user_follow_request ufr WHERE uf.following_id = b.user_id AND uf.following_id = ufr.friend_id AND ufr.status = 'approved' AND ufr.user_id = u.user_id AND u.user_id != b.user_id AND u.active != 0 GROUP BY u.user_id) …

Member Avatar for cereal
0
134
Member Avatar for cheelo007

I am unable to maintain a GET variable with this pagination script. Was hoping you all could help. I am using a GET function so the user can choose which categories are displayed. I'm using a pagination script I found online and I am now confronted with this issue, when …

Member Avatar for cheelo007
0
579
Member Avatar for eltonpiko

hi im working on a project please have a look at the form i need to design the database but i think i will need to instered those info in mutiple tables. ![63d1ebd9a2c0d208980442ded72fb618](/attachments/small/3/63d1ebd9a2c0d208980442ded72fb618.jpg "align-right") hope some one can help me out with this one.the sss1 radio option corespond to the …

Member Avatar for eltonpiko
0
181
Member Avatar for nubie.net

hello, my appreciating, if you give example code in my problem i have 1 file csv with dilimited only column A example column a name | address | phone | birthofdate deby | jersey | 123456 | 01-March-1990 my case is I want to convert to txt with delimited | …

Member Avatar for nubie.net
0
516

The End.