Postingan lainnya
Parse error: syntax error, unexpected 'mssql_query' (T_STRING) in
kalo error gini apa nya yah ? siapa au ada yang ngerti maaf masih newbe....
<?php
$servername = "SERVER";
$username = "hpuser";
$password = "paiho@adminweb";
$dbname = "phmis";
$koneksi = mssql_connect($servername, $username, $password, $dbname);
if ($koneksi->connect_error) {
die("Connection failed: " . $koneksi->connect_error);
}
if($_POST['rowid']) {
$id = $_POST['rowid'];
$sql = ("SELECT * FROM [cust_pric] WHERE cp_cid = $id");
$result = $koneksi mssql_query ($sql);
foreach ($result as $baris) { ?>
<table class="table">
<tr>
<td>cp_cid</td>
<td>:</td>
<td><?php echo $baris['cp_cid']; ?></td>
</tr>
<tr>
<td>cp_mate</td>
<td>:</td>
<td><?php echo $baris['cp_mate']; ?></td>
</tr>
<tr>
<td>cp_hues</td>
<td>:</td>
<td><?php echo $baris['cp_hues']; ?></td>
</tr>
</table>
<?php
}
}
$koneksi->close();
?>
0
2 Jawaban:
Jawaban Terpilih
coba kayak gini <pre> $sql = ("SELECT * FROM [cust_pric] WHERE cp_cid = $id"); $result = mssql_query($koneksi,$sql); </pre> semoga membantu ^^
0
kamu typo mas. coba perhatikan penulisan mysql_querynya. harusnya
<pre> $sql = ("SELECT * FROM [cust_pric] WHERE cp_cid = $id"); $result = $koneksi mysql_query ($sql); </pre>
bukan <pre> $sql = ("SELECT * FROM [cust_pric] WHERE cp_cid = $id"); $result = $koneksi mssql_query ($sql); </pre>
0