PHP: problem with index.php


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PHP: problem with index.php
# 8  
Old 07-02-2003
I'd watch while ($story = mysql_fetch_array($result)) - it looks like you might be assigning a new value to $story. Is there a comparison operator, like == ?
# 9  
Old 07-03-2003
i wrote this one, and get no errors, but it wont display anything . It will coneect to the db, cause if i change stuff in the dbconnect.php, it displays unable to connect to db, which is the custom error i put in. I have changed db's to make sure i didnt make a mistake in creating the db, but still nottin. Whats wrong with the script?


<?php

include('dbconnect.php');
include('header.php');

$result = mysql_query("select * from message")
or die (mysql_error());

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

print $row['text'];

}
mysql_free_result($result);



?>
# 10  
Old 07-03-2003
# 11  
Old 07-03-2003
that worked Smilie thanks, now

PHP doesnt really support html stuff, so have alook at this

www.compulearn.ie and see the text, with the picture, how do i get php to display exactly like that, but php gets it from mysql.

what kinda code would i have to put into mysql for php to display like that,

ive made the menu bar on the left part of the header.php, but php puts the text from mysql underneat that, how do i get php to put the text where it is on the website, do i have to put like <<maintext>> thing in so it will place the text there ?

Thanks
# 12  
Old 07-06-2003
okay, heres the problem.

i have drawin a diagram below to show what happens when my sql print the text. I have a header and left bar, named header.php ( includes the left bar) and it puts the text under all that as shown.

+--------------------------------------------------------+
| |
| HEADER |
+---------+----------------------------------------------+
| Home |
| News |
| Links |
| Contact|
| Join Us|
| Login |
| Register|
+----------+
TEXT ENDS UP DOWN HERE

But i want it like this

+--------------------------------------------------------+
| |
| HEADER |
+---------+----------------------------------------------+
| Home | I WANT THE TEXT TO GO HERE LIKE
| News | THIS BUT IT WONT DO IT FOR ME !!!!
| Links |
| Contact|
| Join Us|
| Login |
| Register|
+----------+




Can someone tell me y mysql puts the text down under everything??
I also want to have a admin interface to edit that e.g.

A text box and a edit button and it will change the text.

Please someone help me
# 13  
Old 07-07-2003
I think it'd help if you pasted the contents of header.php, if it's not too big...
# 14  
Old 07-07-2003
its too big.

is it possible to get mysql to print to a varaible?eg...


+--------------------------------------------------------+
| |
| HEADER |
+---------+----------------------------------------------+
| Home |
| News |
| Links |
| Contact| $printhere
| Join Us|
| Login |
| Register|
+----------+
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies

2. Red Hat

Update php 4.3 RPM to php 5.3.3 php

Dear All, My redhat version is: # cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 4) # # uname -a Linux cotapplication3.cot.com 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux # I want to update my php from: # php... (1 Reply)
Discussion started by: monojcool
1 Replies

3. UNIX for Advanced & Expert Users

Running multiple php scripts into one php only, cron mail alert problem...

hi, while separated they produce the usual mail alert and i can see the output... if i write into the php script: <?php system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script1.php'); system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script2.php'); system('php -f... (0 Replies)
Discussion started by: 7stars
0 Replies

4. Web Development

I can't open my index.php page after insert php code

Hello guys, Does anyone can help me? I've just made my simple index.php without any code, but after insert session code to check if any user is authenticated, my index.php doesn't work anymore. Any fresh eyes could help me to see what and where the code is wrong? <? if... (6 Replies)
Discussion started by: metalfreakbr
6 Replies

5. Shell Programming and Scripting

Index problem with awk

Hello, I have this code: #!/bin/sh awk -v val="........." 'BEGIN{FS=OFS=" ";c=0} NR==FNR&&d==0{a=$0; c++;next} FNR==(NR-c){b=val;next} {if(1234 in a){print "okay"}} {print $1}' listi fpr.11 grn that is working (awk find the value in the table "a" and return "okay" followed by 1234) ... (2 Replies)
Discussion started by: jolecanard
2 Replies

6. Filesystems, Disks and Memory

why the inode index of file system starts from 1 unlike array index(0)

why do inode indices starts from 1 unlike array indexes which starts from 0 its a question from "the design of unix operating system" of maurice j bach id be glad if i get to know the answer quickly :) (0 Replies)
Discussion started by: sairamdevotee
0 Replies

7. Linux

PHP problem

Hi frnds I installed phpmyadmin for OTRS but when ever i tried to open the phpMyAdmin-2.6.2/index.php page i m getting the following error " urldecode the db name if (isset($lightm_db)) { // no longer urlencoded because of html entities in the db name // $db =... (8 Replies)
Discussion started by: naik_mit
8 Replies
Login or Register to Ask a Question