/    Sign up×
Community /Pin to ProfileBookmark

Help with database

There r a few pages that im doing that doesnt show the info on the page from the database but it shows on the ftp site everything is the same just wondering y it doesnt show

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@tirnaMay 15.2010 — are you 100% certain your scripts actually connect to the database on the server?

If yes, then post your code after which I think you will have a much better chance of getting some help.

I can't help anymore without seeing any code.
Copy linkTweet thisAlerts:
@Arnie7294authorMay 17.2010 — <?php

include('admin/db1.php');
mysql_select_db($database);

$limit = 5;
$query_count = "SELECT * FROM eternal_patientforms ORDER BY id ASC";
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);

if(empty($page)){
$page = 1;
}
$limitvalue = $page * $limit - ($limit);
$query = "SELECT * FROM eternal_patientforms ORDER BY id DESC LIMIT $limitvalue, $limit";

$result = mysql_query($query) or die ("Failed to execute query: " . db_error() . '<br>SQL: ' . $db_query);
$color1 = "#ffffff";
$color2 = "#eeeeee";
$row_count = 0;

?>





<?php

while($row = mysql_fetch_array($result)) {

// Set row color

$id = $row ["id"];

//$desc = $row['story'];

$new = preg_replace(

'/<img (.*?)src="[a-z0-9.://-]+"(.*?)>/i',


'',


$row[description]

);

$new = preg_replace(

'/<strong>/i',


'',


$new

);

$new = preg_replace(

'/<p>/i',


'',


$new

);

//$output = preg_replace('/<img src="[a-z0-9.]+"/i', '<img src=""', $desc);

//$desc = preg_replace('/<img src="[a-z0-9.]+"/i', '', $desc);

$text = substr($new,0,130);

?>

<?php

$row['date'] = date("M jS Y" ,strtotime($row['date']));

?>



<p>
<div style="text-align:left;">
<strong>
<a href="admin/user/files/<?php echo $row['file']; ?>"><? echo $row['manualname']; ?></a>
</strong>
</div>

<div>
<?php echo $text; ?>...
</div>
<br />&nbsp;
</p>

<?php
$row_count++;
}

?>



<br />&nbsp;

<br />&nbsp;

<div class="newsdisplay">
<?
if($page != 1){
$pageprev = $page-1;

echo("<a href="$PHP_SELF?page=$pageprev">Prev </a> ");
}else{
echo("Prev ");
}

$numofpages = $totalrows / $limit;

for($i = 1; $i <= $numofpages; $i++){
if($i == $page){
echo("<big>".$i." </big>");
}else{
echo("<a href="$PHP_SELF?page=$i">$i</a> ");
}
}


if(($totalrows % $limit) != 0){
if($i == $page){
echo("<big>".$i." </big>");
}else{
echo("<a href="$PHP_SELF?page=$i">$i</a> ");
}
}

if(($totalrows - ($limit * $page)) > 0){
$pagenext = $page+1;

echo("<a href="$PHP_SELF?page=$pagenext"> Next</a>");
}else{
echo(" Next");
}
?>
×

Success!

Help @Arnie7294 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...