Simple table query syntax error?

I hope someone here can help me see where this error is coming from. I have a form with two fields: email and password. The form's action takes it to a php page that is supposed to start a session connect to a database via mysql run a query and select a row in a table where the email field is similar to the email submitted in the form. At this stage it is incomplete, I only echo so

简单的表查询语法错误?

我希望这里有人能帮我看看这个错误来自哪里。 我有一个有两个字段的表单:电子邮件和密码。 表单的动作将它带到应该使用的php页面 开始一个会话 通过mysql连接到数据库 运行查询并在表格中选择一个电子邮件字段类似于表单中提交的电子邮件的行。 在这个阶段它是不完整的,我只回应脚本末尾的一些字段,看它是否有效。 我测试了它,并且在最后一行发现了一个意外的结束错误; 我遗漏了一个支架。 所以我虽然没有其

Help with a unexpected T

Now I have fixed the problem the T_ELSE parse error is not displaying anymore, But then how can I direct the code to display the if or the else? Well users are going to come from either page1.php or page2.php url coming from page1.php cart.php?ids=1 url coming from page2.php cart.php?idc=1 for instance if the url is coming from page1.php then cart is going to receive it like $ids= isset($_

帮助意外的T

现在我已经解决了T_ELSE解析错误不再显示的问题,但是如何指示代码显示if或else? 那么用户将来自page1.php或page2.php url coming from page1.php cart.php?ids=1 url coming from page2.php cart.php?idc=1 例如,如果网址来自page1.php,那么购物车就会收到它 $ ids = isset($ _ GET ['ids'])?(int)$ _GET ['ids']:null; $ idc = isset($ _ GET ['idc'])?(int)$ _GET ['idc&

PHP Parse error: syntax error, unexpected T

I looked at many other questions, but I can't find my own answer in it. here is my syntax error (unexpeted T_IF): if (isset($_POST['Submit'])) { $Nom=$_POST['Nom']; $debPeriode=$_POST['debPeriode']; $deb=$_POST['deb']; $finPeriode=$_POST['finPeriode']; $fin=$_POST['fin']; $Detail=$_POST['Detail']; $Periode=$deb_Periode.$deb."-".$fin_Periode.$fin //création de la requête SQL: if (empty($

PHP解析错误:语法错误,意外的T

我看了很多其他问题,但我无法找到自己的答案。 这是我的语法错误(未展开的T_IF): if (isset($_POST['Submit'])) { $Nom=$_POST['Nom']; $debPeriode=$_POST['debPeriode']; $deb=$_POST['deb']; $finPeriode=$_POST['finPeriode']; $fin=$_POST['fin']; $Detail=$_POST['Detail']; $Periode=$deb_Periode.$deb."-".$fin_Periode.$fin //création de la requête SQL: if (empty($Nom)||empty($Periode)||empty($Detail))

Regex pattern for preg

Possible Duplicate: How to extract img src, title and alt from html using php? I want to allow users upload images to uploads/tmp folder for future use in their posts. 1. User uploads several images to 'uploads/tmp/' Here is his text: Some text with img tags: 1. <img src="http://site.com/uploads/tmp/d272b2d4.jpg"> 2. <img src="http://www.site.com/uploads/tmp/132784c

preg的正则表达式模式

可能重复: 如何从HTML中使用PHP提取img src,title和alt? 我想让用户上传图片上传/ tmp文件夹,以备将来使用。 1.用户上传几张图片到'uploads / tmp /'这是他的文字: Some text with img tags: 1. <img src="http://site.com/uploads/tmp/d272b2d4.jpg"> 2. <img src="http://www.site.com/uploads/tmp/132784ca.jpg"> 3. <img src="www.site.com/uploads/tmp/e08b0bc8.jpg">

if block inside echo statement?

I suspect it's not allowable because I am getting "Parse error: syntax error, unexpected T_IF in..." error. But I couldn't find a way to accomplish my goal. Here's my code: <?php $countries = $myaddress->get_countries(); foreach($countries as $value){ echo '<option value="'.$value.'"'.if($value=='United States') echo 'selected="selected"';.'>'.$valu

如果块内部的回声陈述?

我怀疑这是不允许的,因为我得到“解析错误:语法错误,意外的T_IF在...”错误。 但是我找不到实现我的目标的方法。 这是我的代码: <?php $countries = $myaddress->get_countries(); foreach($countries as $value){ echo '<option value="'.$value.'"'.if($value=='United States') echo 'selected="selected"';.'>'.$value.'</option>'; } ?> 它所做的是显示select元素中的国家/地区

PHP if statement in html

I am new to HTML5 and PHP, I am trying to output a specific value in table data, If the database-retrieved-value is per condition. My code: <table class="scroll"> <thead style="background-color: #99E1D9; color: #705D56;"> <tr> <th>ID</th> <th>Name Client</th> <th>Last Update</th> &

PHP if语句在html中

我是HTML5和PHP的新手,我试图在表数据中输出一个特定的值,如果数据库检索的值是每个条件。 我的代码: <table class="scroll"> <thead style="background-color: #99E1D9; color: #705D56;"> <tr> <th>ID</th> <th>Name Client</th> <th>Last Update</th> <th style="padding-left: 30%;">Status

How to echo a MySQLi row in escaped PHP code, inside an HTML block

I'm wondering what is the appropriate syntax is to echo a row from MySQLi code in a block of HTML text. I'm working on a page that uses PHP code at the start to determine if a session is started and to post comments that user has posted, after pulling said comments from a MySQLi database. The interesting and confusing part is, I've accomplished what I'm trying to do in one HTML

如何在HTML块内跳转PHP代码中的MySQLi行

我想知道什么是适当的语法是从一段HTML文本中的MySQLi代码中回显一行。 我正在开始使用PHP代码的页面来确定会话是否已启动,并在从MySQLi数据库中提取所述评论之后发布用户发布的评论。 有趣和令人困惑的部分是,我已经完成了我想要在一个HTML div中做的事情,但似乎无法让它在下一个工作。 <?php $page_title = "store"; require_once('connectvars.php'); require_once('startsession.php'); require

returning result from database in drop down list with parse error

我想从数据库中的另一个表中检索下拉列表中的字段值形式的数据库,但我不断收到解析错误:语法错误,意外的T_IF <?php $result1 = mysql_query("SELECT `CompanyID`, `Name` FROM `company`") or trigger_error(mysql_error()); while($row1 = mysql_fetch_array($result1)) { foreach($row1 AS $key1 => $value1) { $row1[$key1] = stripslashes($value1); }

从下拉列表中返回数据库结果,并带有解析错误

我想从数据库中的另一个表中检索下拉列表中的字段值形式的数据库,但我不断收到解析错误:语法错误,意外的T_IF <?php $result1 = mysql_query("SELECT `CompanyID`, `Name` FROM `company`") or trigger_error(mysql_error()); while($row1 = mysql_fetch_array($result1)) { foreach($row1 AS $key1 => $value1) { $row1[$key1] = stripslashes($value1); }

parse error in php for the statement syntax, missing something

I'm trying to echo the value of the field form the database in the drop-down list retrieved from another table in the database, but I keep getting the Parse error: syntax error, unexpected T_IF I know i am m missing something in the brackets to comma, but I can't seem to see it, <?php $result1 = mysql_query("SELECT `CompanyID`, `Name` FROM `company`") or trigger_error(mysql_e

在语法语法的php中解析错误,缺少一些东西

我试图从数据库中的另一个表中检索下拉列表中的字段值形式的数据库,但我不断收到解析错误:语法错误,意外的T_IF 我知道我错过了括号中的逗号,但我似乎无法看到它, <?php $result1 = mysql_query("SELECT `CompanyID`, `Name` FROM `company`") or trigger_error(mysql_error()); while($row1 = mysql_fetch_array($result1)) { foreach($row1 AS $key1 => $value1) { $ro

PHP form verification

I'm new to PHP so please be gentle! I'm trying to build a simple PHP form validation with an error message/confirm message. When I submit the form, it's supposed to check if fields are empty and display the corresponding message. But it keeps giving me an error and I have no idea why: Parse error: syntax error, unexpected T_IF in process.php on line 6 Here's process php co

PHP表单验证

我是PHP新手,请温和! 我试图用错误消息/确认消息来构建一个简单的PHP表单验证。 当我提交表格时,应该检查字段是否为空并显示相应的消息。 但它一直给我一个错误,我不知道为什么: 解析错误:语法错误,第6行的process.php中出现意外的T_IF 这里是过程php代码。 <form action="process.php" method="post"> First Name: <input type="text" name="fname"><br> Last Name: <input type="text" na