04.08.2018, 10:31
A real good step to reading and understanding, is making your code readable, and consistent.
Looks a lot better and readable.
Now, if you put in some print statements, you'll get some more info back.
Mind out for mixing variable methods. UPPERCASE, lowercase, Capitalized and all that. Keep it consistent from the start, and you'll find it easier to pick up where you left off in the future.
Код:
forward CarCheck(); public CarCheck() { new rows,fields; cache_get_data(rows,fields); new fetch[24]; new msg[200]; if(rows>0) { for(new rowas = 0; rowas != rows; rowas++) { cache_get_field_content(rowas, "Name", fetch); format( msg, sizeof(msg), "SELECT * FROM `users` WHERE Name = '%s'",fetch); mysql_function_query(MysqlConnection,msg,true,"CarCheck2","s",fetch); } } return 1; }
Код:
forward CarCheck2(name[]); public CarCheck2(name[]) { new rows,fields; cache_get_data(rows,fields); new msg[200]; if(rows==0) { format( msg,sizeof( msg ),"DELETE FROM `cars` WHERE Name = '%s'",Name); mysql_function_query(MysqlConnection,msg,false,"",""); return 1; } return 1; }
Now, if you put in some print statements, you'll get some more info back.
PHP код:
forward CarCheck();
public CarCheck()
{
new rows,fields;
cache_get_data(rows,fields);
new fetch[24];
new msg[200];
if(rows>0)
{
for(new rowas = 0; rowas != rows; rowas++)
{
cache_get_field_content(rowas, "Name", fetch);
format( msg, sizeof(msg), "SELECT * FROM `users` WHERE Name = '%s'",fetch);
printf('CarCheck for %s', fetch);
mysql_function_query(MysqlConnection,msg,true,"CarCheck2","s",fetch);
}
}
return 1;
}
PHP код:
forward CarCheck2(name[]);
public CarCheck2(name[])
{
new rows,fields;
cache_get_data(rows,fields);
new msg[200];
if(rows==0)
{
format( msg,sizeof( msg ),"DELETE FROM `cars` WHERE Name = '%s'",Name); //This won't fire, due to name, not Name....???
printf('CarCheck2 (Deletion) for %s', name);
mysql_function_query(MysqlConnection,msg,false,"","");
return 1;
}
return 1;
}