28.11.2014, 17:21
Quote:
Hello!
MySQL R39-2, when doing an INSERT INTO, we do not specify the id. Is it possible to force to use a specific id? Ex: Force to insert a line with a given id. |
Hello!
MySQL R39-2, when doing an INSERT INTO, we do not specify the id. Is it possible to force to use a specific id? Ex: Force to insert a line with a given id. |
mysql_fetch_row_format Description: Use this function to fetch whole row from the result set. Image:32px-Ambox_warning_orange.png Note This function also moves the internal row pointer to the next row. |
new data[4];
new row_data[128];
while(mysql_fetch_row_format(row_data))
{
sscanf("p<|>...", data[0], data[1], ...);
}
new data[4]; for(new r=0; r < cache_num_rows(); r++) { data[0] = cache_get_row_int(r, 0); //store the first field (index '0') into data[0] data[1] = cache_get... }
#include <a_samp>
#define MYSQL_USE_YINLINE
#include <a_mysql>
new dbhandle;
forward Qt();
public Qt() {
print("Public instead");
}
public OnGameModeInit() {
dbhandle = mysql_connect("localhost", "root", "samp_733", "");
inline Fetch() {
printf("Inline");
}
mysql_tquery_inline(dbhandle, "SELECT 2 + 2 AS foobar FROM dual", using inline Fetch, "");
mysql_tquery(dbhandle, "SELECT 2 + 2 AS foobar FROM dual", "Qt", "");
return 1;
}
main() {
print("Hello");
}
[11:26:03] Hello [11:26:03] Number of vehicle models: 0 [11:26:03] Inline [11:26:03] Inline [11:26:03] Public instead |
new tmp[32];
cache_get_field_content(0, "IntField",tmp);
place_where_i_want_to_put_it = (ismysqlnull(tmp)) ? (some int value) : (strval(tmp));
I understand that they are completely different. I'm just asking for a easier way to check if it's null. Something like "is_field_null(row, const fieldname[])" would be nice.
|
SELECT * FROM table_name WHERE field_name IS NULL
bool:cache_is_field_null(row_idx, const field_name[]) { new dest[5]; cache_get_field_content(row_idx, field_name, dest); return (strcmp(dest, "NULL") == 0); }