Php SQL syntax error [duplicate] - php

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 6 years ago.
Whats wrong in following query???
am getting error
Parse error:
syntax error, unexpected 'INSERT' (T_STRING)
$NEW_TOKEN = mysql_query("INSERT INTO `iPhone_users` (`DEVICE_TOKEN`,`NAME`,`LOGIN_ID`,`CREATED_AT`) VALUES ('$DEVICE_TOKEN','$STUDENT_FIRST_NAME','$LOGIN_ID','$TODAY')");

You need to close either a single quote or double quote which started before the line you pasted. There is nothing wrong with the query itself.
The error you are getting is a PHP parse error.

Related

I can't get what's worng in this code it made website down [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 1 year ago.
I'm getting error in the PHP code it's a Wordpress custom theme, it made my website down.
PHP Syntax Check:
Parse error: syntax error, unexpected '$', expecting variable (T_VARIABLE) in your code on line 1
Here is the code:
$path = "/home/u921722263/domains/fallcomlegal.co/public_html/wp-content/!function($){$.easing.jswing=$.easing.swing,$.extend($.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){return(t/94256)}";
There is a Syntax errorin this part:
{return $.easing$.easing.def},
because $.easing is followed with a $ there should be a , or something else.
Try fixing this part.

Parse error: syntax error, unexpected 'echo' (T_ECHO) in D:\Bureau\Codage\Wamp\www\index.php on line 5 [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 1 year ago.
When I execute this code it says to me the error in the title.
The code:
if(isset($_POST['name'])) {
$name=$_POST['name']
echo 'test';
}
I know it's a little code but I don't find the error.
Can you help me pls?
missing semmicolon at end of the line.
$name=$_POST['name'];

PHP variable links? [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 4 years ago.
I'm trying to echo a link to the bio of a certain person by clicking on his name and the quotations are getting really confusing...
echo("http://localhost/grav1ty/bio.php?bio=".$_SESSION['username'].'>$_SESSION['username']");
gives me an error message:
"Parse error: syntax error, unexpected 'username' (T_STRING) in C:\UwAmp\www\grav1ty\mailbox.php on line 34"
Any suggestions?!
Thanks,
for string value use quote
INSERT INTO posts (posterid, posterusername, path)
VALUES (1, 'grud', 'uploads/5bb081a7dbb660.55196915.png')

PHP Parse error: syntax error, unexpected 'preg_match' (T_STRINGd [duplicate]

This question already has answers here:
PHP parse/syntax errors; and how to solve them
(20 answers)
Closed 5 years ago.
When i try to run this script :
include('db.php');
$site=file_get_contents("https://example.com");
$baslik='#<title>(.*?)</title>#si';
$içerik='#<div class="post-content">(.*?)</div>#si';
$kategori='#<p class="post-categories"><span>Kategoriler:(.*?)</a></p>#si';
preg_match($baslik,$site,$baslikfonksiyon);
preg_match($icerik,$site,$icerikfonksiyon);
preg_match($kategori,$site,$kategorifonksiyon);
$baslikkullan=$baslikfonksiyon[1];
$icerikkullan=$icerikfonksiyon[1];
$kategorikullan=$kategorifonksiyon[1];
i see this error in error_log file :
[01-Mar-2017 20:39:41 UTC] PHP Parse error: syntax error, unexpected
'preg_match' (T_STRING) in /example/file/path on line 9
Can anyone explain to me why i get this error
Thanks.
I think you have problem with the regex. Try with:
$baslik = '^.*?<\/title>';

php parse/syntax error - help [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
php parse/syntax error help
I keep getting a "Parse error: syntax error, unexpected ':', expecting ')' in /home/jobkill/public_html/process.php on line 8" when processing inputs from a page that redirects here. I dont know what to fix.
You cant use these backquotes, use
"
instead

Categories