遇到MAX(column_name)语法问题 [英] having problem with MAX (column_name) syntax

查看:144
本文介绍了遇到MAX(column_name)语法问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我在选择预订表格中选择名为预订ID的列数的最大数量时遇到问题



i写了这样的sytax

hi guys i am having problem in selecting the maximum of number of a column called booking id, in a 'booking' table

i wrote my sytax like this

<?php

include 'configuration.php';

$sql= mysql_query("select max(booking_id) from booking ");

if(!$sql){echo "syntax error";}else{

while($row = mysql_fetch_array($sql)){

        $booking_id = $row['booking_id'];

        echo $booking_id;
    }
}



?>





但它给我一个这样的错误...

(!)注意:未定义的索引:在C:\中的booking_id第11行wamp\\\\ aerirlines \ test.php

通话栈

#时间记忆功能位置

1 0.0009 324472 { main}().. \ test.php:0



but it is giving me an error like this ...
( ! ) Notice: Undefined index: booking_id in C:\wamp\www\airlines\test.php on line 11
Call Stack
# Time Memory Function Location
1 0.0009 324472 {main}( ) ..\test.php:0

推荐答案

sql = mysql_query( < span class =code-string>从预订中选择max(booking_id));

if(!
sql= mysql_query("select max(booking_id) from booking "); if(!


sql){echo 语法错误;} else {

while(
sql){echo "syntax error";}else{ while(


row = mysql_fetch_array(
row = mysql_fetch_array(


这篇关于遇到MAX(column_name)语法问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆