Home : General : Internet Technologies :

General: Internet Technologies: Re: [hennagaijin] Breaking Up a Line using PHP: Edit Log

Here is the list of edits for this post
Re: [hennagaijin] Breaking Up a Line using PHP
I only wish I knew what you guys were talking about :P

However, another new problem has risen. While I was adding strings to the database with a script I've written, some lines (I'm guessing) that contain ' or " are not being added because of syntax errors. I have tried "addslashes()" to it however when I do that I'm losing all the values from the array. Here's what I've got:

<body> <table width="100%" border="1">

// Connect to the database server
$dbcnx = @mysql_connect("localhost", "root");
if (!$dbcnx) {
echo( "<p>Unable to connect to the " .
"database server at this time.</p>" );

// Select the presenttruth database
if (! @mysql_select_db("presenttruth") ) {
echo( "<p>Unable to locate the presenttruth" . "database at this time.</p>" );

$ot_load = file("OT01.txt");

$ot_text = addslashes($_POST['ot_load']);

for ($index=0; $index < count($ot_text); $index++) {
$text = explode(":", chop($ot_text[$index]));

$addsql = "INSERT INTO Bible SET

echo("<tr><td>" . $text[0] . "<br /></td>");
echo("<td>" . $text[1] . "<br /></td>");
echo("<td>" . $text[2] . "<br /></td>");
echo("<td>" . $text[3] . "<br /></td></tr>");

if (@mysql_query($addsql)) {
echo("<h5>Info added successfully.</h5>");
} else {
echo("<h5>Error adding info: " . mysql_error() . "</h5>");



The $text output is just for debugging purposes so you can ignore that.

Last edited by:

JoFrRi: Aug 26, 2003, 3:06 PM

Edit Log: