这是我的第一篇文章,所以请将代码输入到这里。我试图输出一些图像到PDF,并需要创建一个if语句连续查找数据。检查数据是否在表格行
$connection = mysql_connect("localhost", "testdb", "********")
or die ("Unable to connect!");
// select database
mysql_select_db("testdb") or die ("Unable to select database!");
// Select all the rows in the test table
$query = "SELECT * FROM test2 WHERE testid=89";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
while ($row= mysql_fetch_array($result)) {
$image = $row[1];
$text = $row[2];
}
这就是我有这么远,基本上我需要沿着这行的东西:
If (data in row 1) {
print $image;
} else {
print $text;
}
贵表包含哪些数据? – Vamsi 2012-08-08 11:59:33
只是从表单输入的文本和图像路径 – Josh 2012-08-08 12:26:55