Code Comments
Programming Forum and web based access to our favorite programming groups.I have worked to have a very generic code so that I could modify it to be used with any database. My query-sentence I now looks like this: $mysql_query_sentence= $sql_work[$sql_work_sql][$sql_taeller].$sql_data[$sql_num][$sql_taeller++] .$sql_work[$sql_work_sql][$sql_taeller].$sql_data[$sql_num][$sql_taeller++] .$sql_work[$sql_work_sql][$sql_taeller].$sql_data[$sql_num][$sql_taeller++] .$sql_work[$sql_work_sql][$sql_taeller].$sql_data[$sql_num][$sql_taeller++] ; How could I write some code to have this produced automatically?
Post Follow-up to this messageTry some loops (eg. "foreach", "for", "while").
Egzample with "for":
<?php
$mysql_query_sentence = '';
foreach( $sql_taeller = 0; $sql_taeller < count( $sql_data[$sql_num] ); $sql
_taeller++ )
{
$mysql_query_sentence .= $sql_work[$sql_work_sql][$sql_taeller].$sql_data[$s
ql_num][$sql_taeller];
}
?>
Hilarion
PS.: Wouldn't it be easier to store SQL queries for each DB as whole? Your m
ethod makes
the code really hard to read.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.