[Solved] Is my SQL syntax really wrong? [closed]

Try adding white spaces between your query words and make sure you escape the input: $id = mysql_real_escape_string($id); $str = mysql_real_escape_string($str); $name = mysql_real_escape_string($name); $r=mysql_query(“INSERT INTO varta (id,data,name) VALUES (‘$id’,’$str’,’$name’);”); Or better yet – take a look at MySQLi or PDO and use prepared statements. solved Is my SQL syntax really wrong? [closed]

[Solved] I got this error “Operand should contain 1 column(s)” where am i wrong?

you have to remove the () from values , or it will be considered as one entry . try that: INSERT INTO evraklar(evrak_tipi_grubu, evrak_tipi, evrak_konu, evrak_subeye_gelis_tarihi, evrak_gonderen, evrak_alici, evrak_tarihi, evrak_sayisi, evrak_aciklama, evrak_kurum_icindenmi, gelen_evrak_tarihi, gelen_evrak_sayi, gelen_evrak_etakip, evrak_kaydeden_ybs_kullanici_id,kaydeden_kullanici_birim_id) VALUES (6,43,’Test amaçlı girilen konu’,STR_TO_DATE(’12/12/2012′, ‘%d/%m/%Y’),0,566,STR_TO_DATE(’12/12/2012′, ‘%d/%m/%Y’),’5555555555′,’YBS:110 nolu evrağa cevaben yazılan yazıdır. Alıcısı:Antalya Valiliği – İl Sağlık Müdürlüğü’,0,STR_TO_DATE(’12/12/2012′, ‘%d/%m/%Y’),’5555555555′,777777777,1,685), … Read more

[Solved] Which Insert query run faster and accurate?

TL;TR The second query will be faster. Why? Read below… Basically, a query is executed in various steps: Connecting: Both versions of your code have to do this Sending query to server: Applies to both versions, only the second version sends only one query Parsing query: Same as above, both versions need the queries to … Read more

[Solved] How to insert a character after every n characters in a huge text file using C#? [closed]

void InsertACharacterNoStringAfterEveryNCharactersInAHugeTextFileUsingCSharp( string inputPath, string outputPath, int blockSize, string separator) { using (var input = File.OpenText(inputPath)) using (var output = File.CreateText(outputPath)) { var buffer = new char[blockSize]; int readCount; while ((readCount = input.ReadBlock(buffer, 0, buffer.Length)) > 0) { output.Write(buffer, 0, readCount); if (readCount == buffer.Length) output.Write(separator); } } } // usage: InsertACharacterNoStringAfterEveryNCharactersInAHugeTextFileUsingCSharp( inputPath, outputPath, 3, … Read more

[Solved] why doesn’t my sorted code work in c? [closed]

#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *nextPtr; }; struct node *firstPtr = NULL; void insertioon (int d){ struct node *np, *temp, *prev = NULL; int found; np=malloc(sizeof(struct node)); np->data = d; np->nextPtr = NULL; temp=firstPtr; found=0; while ((temp != NULL) && !found) { if (temp->data <d) { prev = temp; … Read more

[Solved] Insert data in mysql colum with spaces with php

why dont you use the sql error ? so you can see what the msitake is . try this mysql_query(“INSERT INTO bestellingen ($qw1) VALUES ($qw2)”) or die(mysql_error()); use backticks around this also `ORDER DATE` Note: this ` is not same as this ‘ try this $qw2 = $vnaam .’,’.$anaam .’,’.$straat.’,’. $code.’,’. $geboorte.’,’. $tel.’, ‘.$email.’, ‘.$dateandhour … Read more

[Solved] How to insert values into a mysql database using php

/* * SQL CREATE TABLE `NewTable` ( `id` int NOT NULL AUTO_INCREMENT , `col1` varchar(255) NOT NULL , `col2` varchar(255) NOT NULL , `col3` varchar(255) NOT NULL , PRIMARY KEY (`id`) ) ; * * /SQL */ $mysqli = new mysqli(“localhost”, “DB_USERNAME”, “DB_PASSWORD”, “DB_NAME”); if($mysqli->connect_error) { die(‘Connect Error’ . $mysqli->connect_error); } $mysqli->query(“SET NAMES ‘utf8′”); $mysqli->query(“SET … Read more

[Solved] Python String unwanted overwrite

Change the 9 to a 10: if temp2[4] == ‘-‘ and temp2[10] != ‘-‘: temp3 = temp2[:10] + ‘-‘ + temp2[10:] When you call a string its str[from:to], so temp2[:9] is equivalent to temp2[0:9] and it would only return the characters from 0-9 instead of the required 0-10 0 solved Python String unwanted overwrite

[Solved] T-SQL INSERT INTO disabling Constraints check

Constraint is on the table not a single statement Kind of ugly but Put it in a transaction and take a tablock begin transaction ALTER TABLE branchOffice NOCHECK CONSTRAINT ALL insert into branchOffice with (tablock) — Re-enable the constraints on a table ALTER TABLE branchOffice WITH CHECK CHECK CONSTRAINT ALL commit transation; 3 solved T-SQL … Read more

[Solved] Selecting the right column

Both. In some rows, t2.number is number and in others t3.number is number. The result of the union all in a single result set. The result set doesn’t know the origin of the values in any particular column (although you could include another column with this information). 3 solved Selecting the right column

[Solved] A Parse error with the PHP mysql Class function of insert method

This line of code isn’t closed: $this->query(“INSERT INTO testing_Rand (number1, // etc and you are missing a ; after this line: $newRand.=implode(‘,’, $varNum) If I get it, you meant to write this instead: public function insert_SQL($varNum ) { $this->query(“INSERT INTO testing_Rand (number1, number2, number3, number4, number5, number6, number7, number8, number9, number10) VALUES (“.implode(‘,’, $varNum).”)”); } … Read more

[Solved] error mysql_query() expects parameter 1 to be string

Your query should look like this: $insertData = “INSERT INTO facebook (fdId, fullName, email, dob, location, gender, postId) VALUES (‘”.$fbId.”‘,'”.$fullName.”‘,'”.$email.”‘,'”.$new_date.”‘,'”.$location.”‘,'”.$gender.”‘,'”.$postId.”‘)”; mysql_select_db(‘noskunk1_facebook’,$vdb); $result = mysql_query($insertData); if ($result)) { echo “New record created successfully”; } else { echo “Error: ” . $insertData . “<br>” . mysql_error($vdb); } but consider using pdo 3 solved error mysql_query() expects parameter … Read more