fragment code when php uploaded

Status
Not open for further replies.

acellec

New Member
Messages
29
Reaction score
0
Points
0
i uploaded this php script in my xhosting public_html

how come i have this fragment error if open list.php

BMK Automobile PArts

Seach for: in Part Number Part Name Description "; $Row = $QueryResult->fetch_row(); do { echo "{$Row[0]}"; echo "{$Row[1]}"; echo "{$Row[2]}"; echo "{$Row[3]}"; echo "{$Row[4]}"; echo "{$Row[5]}"; echo ""; $Row = $QueryResult->fetch_row(); } while ($Row); echo ""; $DBConnect->close(); ?>


my cpanel username is acellec

heres my code:

dbconnect.php

PHP:
<?
    $DBConnect = mysqli_connect("localhost", "acellec", "15556");
    $DBConnect->select_db("acellec_automobileparts");
    
    $QueryResult = $DBConnect->query($SQLstring)
            Or die("<p>Unable to execute the query.</p>"."<p>Error code ". $DBConnect->errno . ": " . $DBConnect->error) . "</p>";
?>
and heres the code for

list.php

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Automobile Parts</title>
</head>

<body>
<h1>BMK Automobile PArts</h1>
 
<form action="search1.php" method="post">
Seach for: <input type="text" name="find" /> in 
<Select NAME="field">
<Option VALUE="PartNo">Part Number</option>
<Option VALUE="PartName">Part Name</option>
<Option VALUE="Description">Description</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>

<?
$TableName = "automobileparts";
$SQLstring = "SELECT * FROM automobileparts";

require_once("dbconnect.php");
        
echo "<table width='100%' border='1'>";
$Row = $QueryResult->fetch_row();
do {
             echo "<tr><td>{$Row[0]}</td>";
        
        echo "<td align='right'>{$Row[1]}</td>";
        echo "<td align='right'>{$Row[2]}</td>";
        echo "<td align='right'>{$Row[3]}</td>";
        echo "<td align='right'>{$Row[4]}</td>";
        echo "<td align='right'>{$Row[5]}</td>";
                
                echo "<td align='right'><a href=\"edit.php?id={$Row[0]}\">Edit</a></td>";
        echo "<td align='right'><a href=\"delete.php?id={$Row[0]}\">Delete</a></td>";
        echo "</tr>";
        $Row = $QueryResult->fetch_row();
} while ($Row);
echo "</table>";






$DBConnect->close();


?>
<p><a href="insert.php">Add Parts</a></p>
</body>
</html>
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
This is not a free-hosting issue, and that you should be aware no one on these forums will be able to access your cPanel. For free hosting issues, you should open a ticket at support.x10hosting.com. You should open this thread in the programming-help section.

I am not sure what the error is that you are getting.
Code:
Seach for: in Part Number Part Name Description "; $Row = $QueryResult->fetch_row(); do { echo "{$Row[0]}"; echo "{$Row[1]}"; echo "{$Row[2]}"; echo "{$Row[3]}"; echo "{$Row[4]}"; echo "{$Row[5]}"; echo ""; $Row = $QueryResult->fetch_row(); } while ($Row); echo ""; $DBConnect->close(); ?>
Is this what is printed to your page when it loads?
 
Last edited:
Status
Not open for further replies.
Top