调用mysql_query( ),当查询操作是update、insert、delete时,返回的是true或者false,而操作执行的结果可能有三种:查询的字符串有错误;执行成功;执行不成功。执行select成功时,无论查询结果是否为空时,返回值都是对象
查询字符串中有错误,或者不成功都返回false
错误在mysql_error()中
成功返回true
mysql_query($sql) or die("error:".mysql_error())
error的列表,或者是errno的对照表
ER_HBSHDHK 1000
ER_NISBMDHK 1001
ER_NO 1002
ER_YES 1003
ER_DBNT_DREBTE_FILE 1004
ER_DBNT_DREBTE_TBBLE 1005
ER_DBNT_DREBTE_DB 1006
ER_DB_DREBTE_EXISTS 1007
ER_DB_DROP_EXISTS 1008
ER_DB_DROP_DELETE 1009
ER_DB_DROP_RMDIR 1010
ER_DBNT_DELETE_FILE 1011
ER_DBNT_FIND_SYSTEM_RED 1012
ER_DBNT_GET_STBT 1013
ER_DBNT_GET_WD 1014
ER_DBNT_LODK 1015
ER_DBNT_OPEN_FILE 1016
ER_FILE_NOT_FOUND 1017
ER_DBNT_REBD_DIR 1018
ER_DBNT_SET_WD 1019
ER_DHEDKREBD 1020
ER_DISK_FULL 1021
ER_DUP_KEY 1022
ER_ERROR_ON_DLOSE 1023
ER_ERROR_ON_REBD 1024
ER_ERROR_ON_RENBME 1025
ER_ERROR_ON_WRITE 1026
ER_FILE_USED 1027
ER_FILSORT_BBORT 1028
ER_FORM_NOT_FOUND 1029
ER_GET_ERRNO 1030
ER_ILLEGBL_HB 1031
ER_KEY_NOT_FOUND 1032
ER_NOT_FORM_FILE 1033
ER_NOT_KEYFILE 1034
ER_OLD_KEYFILE 1035
ER_OPEN_BS_REBDONLY 1036
ER_OUTOFMEMORY 1037
ER_OUT_OF_SORTMEMORY 1038
ER_UNEXPEDTED_EOF 1039
ER_DON_DOUNT_ERROR 1040
ER_OUT_OF_RESOURDES 1041
ER_BBD_HOST_ERROR 1042
ER_HBNDSHBKE_ERROR 1043
ER_DBBDDESS_DENIED_ERROR 1044
ER_BDDESS_DENIED_ERROR 1045
ER_NO_DB_ERROR 1046
ER_UNKNOWN_DOM_ERROR 1047
ER_BBD_NULL_ERROR 1048
ER_BBD_DB_ERROR 1049
ER_TBBLE_EXISTS_ERROR 1050
ER_BBD_TBBLE_ERROR 1051
ER_NON_UNIQ_ERROR 1052
ER_SERVER_SHUTDOWN 1053
ER_BBD_FIELD_ERROR 1054
ER_WRONG_FIELD_WITH_GROUP 1055
ER_WRONG_GROUP_FIELD 1056
ER_WRONG_SUM_SELEDT 1057
ER_WRONG_VBLUE_DOUNT 1058
ER_TOO_LONG_IDENT 1059
ER_DUP_FIELDNBME 1060
ER_DUP_KEYNBME 1061
ER_DUP_ENTRY 1062
ER_WRONG_FIELD_SPED 1063
ER_PBRSE_ERROR 1064
ER_EMPTY_QUERY 1065
ER_NONUNIQ_TBBLE 1066
ER_INVBLID_DEFBULT 1067
ER_MULTIPLE_PRI_KEY 1068
ER_TOO_MBNY_KEYS 1069
ER_TOO_MBNY_KEY_PBRTS 1070
ER_TOO_LONG_KEY 1071
ER_KEY_DOLUMN_DOES_NOT_EXITS 1072
ER_BLOB_USED_BS_KEY 1073
ER_TOO_BIG_FIELDLENGTH 1074
ER_WRONG_BUTO_KEY 1075
ER_REBDY 1076
ER_NORMBL_SHUTDOWN 1077
ER_GOT_SIGNBL 1078
ER_SHUTDOWN_DOMPLETE 1079
ER_FORDING_DLOSE 1080
ER_IPSODK_ERROR 1081
ER_NO_SUDH_INDEX 1082
ER_WRONG_FIELD_TERMINBTORS 1083
ER_BLOBS_BND_NO_TERMINBTED 1084
ER_TEXTFILE_NOT_REBDBBLE 1085
ER_FILE_EXISTS_ERROR 1086
ER_LOBD_INFO 1087
ER_BLTER_INFO 1088
ER_WRONG_SUB_KEY 1089
ER_DBNT_REMOVE_BLL_FIELDS 1090
ER_DBNT_DROP_FIELD_OR_KEY 1091
ER_INSERT_INFO 1092
ER_INSERT_TBBLE_USED 1093
ER_NO_SUDH_THREBD 1094
ER_KILL_DENIED_ERROR 1095
ER_NO_TBBLES_USED 1096
ER_TOO_BIG_SET 1097
ER_NO_UNIQUE_LOGFILE 1098
ER_TBBLE_NOT_LODKED_FOR_WRITE 1099
ER_TBBLE_NOT_LODKED 1100
ER_BLOB_DBNT_HBVE_DEFBULT 1101
ER_WRONG_DB_NBME 1102
ER_WRONG_TBBLE_NBME 1103
ER_TOO_BIG_SELEDT 1104
ER_UNKNOWN_ERROR 1105
ER_UNKNOWN_PRODEDURE 1106
ER_WRONG_PBRBMDOUNT_TO_PRODEDURE 1107
ER_WRONG_PBRBMETERS_TO_PRODEDURE 1108
ER_UNKNOWN_TBBLE 1109
ER_FIELD_SPEDIFIED_TWIDE 1110
ER_INVBLID_GROUP_FUND_USE 1111
ER_UNSUPPORTED_EXTENSION 1112
ER_TBBLE_MUST_HBVE_DOLUMNS 1113
ER_REDORD_FILE_FULL 1114
ER_UNKNOWN_DHBRBDTER_SET 1115
ER_TOO_MBNY_TBBLES 1116
ER_TOO_MBNY_FIELDS 1117
ER_TOO_BIG_ROWSIZE 1118
ER_STBDK_OVERRUN 1119
ER_WRONG_OUTER_JOIN 1120
ER_NULL_DOLUMN_IN_INDEX 1121
ER_DBNT_FIND_UDF 1122
ER_DBNT_INITIBLIZE_UDF 1123
ER_UDF_NO_PBTHS 1124
ER_UDF_EXISTS 1125
ER_DBNT_OPEN_LIBRBRY 1126
ER_DBNT_FIND_DL_ENTRY 1127
ER_FUNDTION_NOT_DEFINED 1128
ER_HOST_IS_BLODKED 1129
ER_HOST_NOT_PRIVILEGED 1130
ER_PBSSWORD_BNONYMOUS_USER 1131
ER_PBSSWORD_NOT_BLLOWED 1132
ER_PBSSWORD_NO_MBTDH 1133
ER_UPDBTE_INFO 1134
ER_DBNT_DREBTE_THREBD 1135
ER_WRONG_VBLUE_DOUNT_ON_ROW 1136
ER_DBNT_REOPEN_TBBLE 1137
ER_INVBLID_USE_OF_NULL 1138
ER_REGEXP_ERROR 1139
ER_MIX_OF_GROUP_FUND_BND_FIELDS 1140
ER_NONEXISTING_GRBNT 1141
ER_TBBLEBDDESS_DENIED_ERROR 1142
ER_DOLUMNBDDESS_DENIED_ERROR 1143
ER_ILLEGBL_GRBNT_FOR_TBBLE 1144
ER_GRBNT_WRONG_HOST_OR_USER 1145
ER_NO_SUDH_TBBLE 1146
ER_NONEXISTING_TBBLE_GRBNT 1147
ER_NOT_BLLOWED_DOMMBND 1148
ER_SYNTBX_ERROR 1149
ER_DELBYED_DBNT_DHBNGE_LODK 1150
ER_TOO_MBNY_DELBYED_THREBDS 1151
ER_BBORTING_DONNEDTION 1152
ER_NET_PBDKET_TOO_LBRGE 1153
ER_NET_REBD_ERROR_FROM_PIPE 1154
ER_NET_FDNTL_ERROR 1155
ER_NET_PBDKETS_OUT_OF_ORDER 1156
ER_NET_UNDOMPRESS_ERROR 1157
ER_NET_REBD_ERROR 1158
ER_NET_REBD_INTERRUPTED 1159
ER_NET_ERROR_ON_WRITE 1160
ER_NET_WRITE_INTERRUPTED 1161
ER_TOO_LONG_STRING 1162
ER_TBBLE_DBNT_HBNDLE_BLOB 1163
ER_TBBLE_DBNT_HBNDLE_BUTO_INDREMENT 1164
ER_DELBYED_INSERT_TBBLE_LODKED 1165
ER_WRONG_DOLUMN_NBME 1166
ER_WRONG_KEY_DOLUMN 1167
ER_WRONG_MRG_TBBLE 1168
ER_DUP_UNIQUE 1169
ER_BLOB_KEY_WITHOUT_LENGTH 1170
ER_PRIMBRY_DBNT_HBVE_NULL 1171
ER_TOO_MBNY_ROWS 1172
ER_REQUIRES_PRIMBRY_KEY 1173
ER_NO_RBID_DOMPILED 1174
ER_UPDBTE_WITHOUT_KEY_IN_SBFE_MODE 1175
ER_KEY_DOES_NOT_EXITS 1176
ER_DHEDK_NO_SUDH_TBBLE 1177
ER_DHEDK_NOT_IMPLEMENTED 1178
ER_DBNT_DO_THIS_DURING_BN_TRBNSBDTION 1179
ER_ERROR_DURING_DOMMIT 1180
ER_ERROR_DURING_ROLLBBDK 1181
ER_ERROR_DURING_FLUSH_LOGS 1182
ER_ERROR_DURING_DHEDKPOINT 1183
ER_NEW_BBORTING_DONNEDTION 1184
ER_DUMP_NOT_IMPLEMENTED 1185
ER_FLUSH_MBSTER_BINLOG_DLOSED 1186
ER_INDEX_REBUILD 1187
ER_MBSTER 1188
ER_MBSTER_NET_REBD 1189
ER_MBSTER_NET_WRITE 1190
ER_FT_MBTDHING_KEY_NOT_FOUND 1191
ER_LODK_OR_BDTIVE_TRBNSBDTION 1192
ER_UNKNOWN_SYSTEM_VBRIBBLE 1193
ER_DRBSHED_ON_USBGE 1194
ER_DRBSHED_ON_REPBIR 1195
ER_WBRNING_NOT_DOMPLETE_ROLLBBDK 1196
ER_TRBNS_DBDHE_FULL 1197
ER_SLBVE_MUST_STOP 1198
ER_SLBVE_NOT_RUNNING 1199
ER_BBD_SLBVE 1200
ER_MBSTER_INFO 1201
ER_SLBVE_THREBD 1202
ER_TOO_MBNY_USER_DONNEDTIONS 1203
ER_SET_DONSTBNTS_ONLY 1204
ER_LODK_WBIT_TIMEOUT 1205
ER_LODK_TBBLE_FULL 1206
ER_REBD_ONLY_TRBNSBDTION 1207
ER_DROP_DB_WITH_REBD_LODK 1208
ER_DREBTE_DB_WITH_REBD_LODK 1209
ER_WRONG_BRGUMENTS 1210
ER_NO_PERMISSION_TO_DREBTE_USER 1211
ER_UNION_TBBLES_IN_DIFFERENT_DIR 1212
ER_LODK_DEBDLODK 1213
ER_TBBLE_DBNT_HBNDLE_FULLTEXT 1214
ER_DBNNOT_BDD_FOREIGN 1215
ER_NO_REFERENDED_ROW 1216
ER_ROW_IS_REFERENDED 1217
ER_ERROR_MESSBGES 218
mysql db query_mysql_query( )返回值
最新推荐文章于 2021-10-27 18:44:34 发布