I have generated this code with a code generator from Sql Maestro, called PHP Generator for MySQL.
I have asked a question before about my SELECT statement. I finally got passed that, but now 3 of the fields in one of the tables can't capture data. I can see the fields on the screen, but no data can be captured in it since the field is too small. Almost as if the field is ignoring the definition I stipulated on the PhpMyAdmin.
In the function showroweditor, is where I think the problem is, but I am not sure. It is in line 371, more or less. I have highlighted it in green.
The problem fields are SoekBoekID, KlientID and SoekStatusID.
Here is most of the code:
<?php session_start(); ......
</head>
<body>
<table class="bd" width="100%"><tr><td class="hr"><h2>PHP Generator</h2></td></tr></table>
<table width="100%">
<tr>
<td width="10%" valign="top">
<li><a href="boeke.php?a=reset">boeke</a>
<li><a href="kliente.php?a=reset">kliente</a>
<li><a href="lu_afslag.php?a=reset">lu_afslag</a>
<li><a href="lu_buiteblad.php?a=reset">lu_buiteblad</a>
<li><a href="lu_kategorie.php?a=reset">lu_kategorie</a>
<li><a href="lu_kondisie.php?a=reset">lu_kondisie</a>
<li><a href="lu_soekstatus.php?a=reset">lu_soekstatus</a>
<li><a href="lu_taalid.php?a=reset">lu_taalid</a>
<li><a href="lu_uitgewers.php?a=reset">lu_uitgewers</a>
<li><a href="users.php?a=reset">users</a>
</td>
<td width="5%">
</td>
............more code ..............
<?php function select()
{
global $a;
global $showrecs;
global $page;
global $filter;
global $filterfield;
global $wholeonly;
global $order;
global $ordtype;
............more code ..............
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>Table: soekboek</td></tr>
<tr><td>Records shown <?php echo $startrec + 1 ?> - <?php echo $reccount ?> of <?php echo $count ?></td></tr>
</table>
<hr size="1" noshade>
<form action="soekboek.php" method="post">
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><b>Custom Filter</b> </td>
<td><input type="text" name="filter" value="<?php echo $filter ?>"></td>
<td><select name="filter_field">
<option value="">All Fields</option>
<option value="<?php echo "lp_SoekBoekID" ?>"<?php if ($filterfield == "lp_SoekBoekID") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekBoekID") ?></option>
<option value="<?php echo "lp_KlientID" ?>"<?php if ($filterfield == "lp_KlientID") { echo "selected"; } ?>><?php echo htmlspecialchars("KlientID") ?></option>
<option value="<?php echo "SoekTitel" ?>"<?php if ($filterfield == "SoekTitel") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekTitel") ?></option>
<option value="<?php echo "SoekSkrywer" ?>"<?php if ($filterfield == "SoekSkrywer") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekSkrywer") ?></option>
<option value="<?php echo "SoekISBN" ?>"<?php if ($filterfield == "SoekISBN") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekISBN") ?></option>
<option value="<?php echo "SoekUitgewer" ?>"<?php if ($filterfield == "SoekUitgewer") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekUitgewer") ?></option>
<option value="<?php echo "SoekUitgeeplek" ?>"<?php if ($filterfield == "SoekUitgeeplek") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekUitgeeplek") ?></option>
<option value="<?php echo "SoekUitgeeDatum" ?>"<?php if ($filterfield == "SoekUitgeeDatum") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekUitgeeDatum") ?></option>
<option value="<?php echo "SoekWaarGehoor" ?>"<?php if ($filterfield == "SoekWaarGehoor") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekWaarGehoor") ?></option>
<option value="<?php echo "lp_SoekStatusID" ?>"<?php if ($filterfield == "lp_SoekStatusID") { echo "selected"; } ?>><?php echo htmlspecialchars("SoekStatusID") ?></option>
</select></td>
<td><input type="checkbox" name="wholeonly"<?php echo $checkstr ?>>Whole words only</td>
</td></tr>
<tr>
<td> </td>
<td><input type="submit" name="action" value="Apply Filter"></td>
<td><a href="soekboek.php?a=reset">Reset Filter</a></td>
</tr>
</table>
</form>
............more code ..............
[COLOR="SeaGreen"]<?php function showroweditor($row, $iseditmode)
{
global $conn;
?>
<table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekBoekID")." " ?></td>
<td class="dr"><select name="SoekBoekID">
<?php
$sql = "select * from soekboek";
$res = mysql_query($sql, $conn) or die(mysql_error());
while ($lp_row = mysql_fetch_assoc($res)){
$val = $lp_row[""];
$caption = $lp_row[""];
if ($row["SoekBoekID"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("KlientID")." " ?></td>
<td class="dr"><select name="KlientID">
<?php
$sql = "select * from kliente";
$res = mysql_query($sql, $conn) or die(mysql_error());
while ($lp_row = mysql_fetch_assoc($res)){
$val = $lp_row[""];
$caption = $lp_row[""];
if ($row["KlientID"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekTitel")." " ?></td>
<td class="dr"><textarea cols="35" rows="4" name="SoekTitel" maxlength="100"><?php echo str_replace('"', '"', trim($row["SoekTitel"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekSkrywer")." " ?></td>
<td class="dr"><textarea cols="35" rows="4" name="SoekSkrywer" maxlength="100"><?php echo str_replace('"', '"', trim($row["SoekSkrywer"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekISBN")." " ?></td>
<td class="dr"><input type="text" name="SoekISBN" value="<?php echo str_replace('"', '"', trim($row["SoekISBN"])) ?>"></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekUitgewer")." " ?></td>
<td class="dr"><textarea cols="35" rows="4" name="SoekUitgewer" maxlength="60"><?php echo str_replace('"', '"', trim($row["SoekUitgewer"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekUitgeeplek")." " ?></td>
<td class="dr"><input type="text" name="SoekUitgeeplek" maxlength="50" value="<?php echo str_replace('"', '"', trim($row["SoekUitgeeplek"])) ?>"></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekUitgeeDatum")." " ?></td>
<td class="dr"><input type="text" name="SoekUitgeeDatum" value="<?php echo str_replace('"', '"', trim($row["SoekUitgeeDatum"])) ?>"></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekWaarGehoor")." " ?></td>
<td class="dr"><textarea cols="35" rows="4" name="SoekWaarGehoor" maxlength="65535"><?php echo str_replace('"', '"', trim($row["SoekWaarGehoor"])) ?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("SoekStatusID")." " ?></td>
<td class="dr"><select name="SoekStatusID">
<?php
$sql = "select * from lu_soekstatus";
$res = mysql_query($sql, $conn) or die(mysql_error());
while ($lp_row = mysql_fetch_assoc($res)){
$val = $lp_row[""];
$caption = $lp_row[""];
if ($row["SoekStatusID"] == $val) {$selstr = " selected"; } else {$selstr = ""; }
?><option value="<?php echo $val ?>"<?php echo $selstr ?>><?php echo $caption ?></option>
<?php } ?></select>
</td>
</tr>
</table>
<?php } ?>[/COLOR]
............more code ..............
function sql_select()
{
global $conn;
global $order;
global $ordtype;
global $filter;
global $filterfield;
global $wholeonly;
$filterstr = sqlstr($filter);
if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
$sql = "SELECT * FROM (SELECT t1.`SoekBoekID`, t1.`KlientID`, t1.`SoekTitel`, t1.`SoekSkrywer`, t1.`SoekISBN`, t1.`SoekUitgewer`, t1.`SoekUitgeeplek`, t1.`SoekUitgeeDatum`, t1.`SoekWaarGehoor`, t1.`SoekStatusID` FROM `soekboek` AS t1) subq";
if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
$sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
} elseif (isset($filterstr) && $filterstr!='') {
$sql .= " where (`lp_SoekBoekID` like '" .$filterstr ."') or (`lp_KlientID` like '" .$filterstr ."') or (`SoekTitel` like '" .$filterstr ."') or (`SoekSkrywer` like '" .$filterstr ."') or (`SoekISBN` like '" .$filterstr ."') or (`SoekUitgewer` like '" .$filterstr ."') or (`SoekUitgeeplek` like '" .$filterstr ."') or (`SoekUitgeeDatum` like '" .$filterstr ."') or (`SoekWaarGehoor` like '" .$filterstr ."') or (`lp_SoekStatusID` like '" .$filterstr ."')";
}
if (isset($order) && $order!='') $sql .= " order by `" .sqlstr($order) ."`";
if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype);
$res = mysql_query($sql, $conn) or die(mysql_error());
return $res;
}
............more code ..............