Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

please help me diaplay my tables (url included)

Codes here !

Moderators: macek, egami, gesf

Postby Oleg Butuzov » Wed Jul 17, 2002 11:59 am

I did not saw your url, because i have bad connection...


may be

Code: Select all
<?
$user="user";
$pass="pass";
$host="localhost";

$link=mysq_connect($host, $user, $pass);

$mysql_select_db("dbname", $link);

$query=mysql_query("SELECT * FROM 'tablename' ", $link);

for ($i=0; $i < mysql_num_rows($query); $i++)
{
$data=mysql_fetch_array($query);

// now your data in array like $data[collum1]  $data[collum2] $data[collum3]

// do somthing whith this vars
}

?
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Re: Call to undefined function: () in /isp/home/max on line

Postby WiZARD » Thu Jul 18, 2002 10:41 pm

robbyjb wrote:<?php

$connect = mysql_connect("localhost","robbyjb","");
$mysql_select_db("robbyjb", $link);

$query=mysql_query("SELECT * FROM 'psytrance' ", $link);

for ($i=0; $i < mysql_num_rows($query); $i++)

while($row = mysql_fetch_array($result))
{
echo$row["record"];
}
?>
I viewed the psytrance.myi form & .frm .myd using zend at there ftp site & they appeared to be there intact.


Hi my dear little friend!
1 Check your connection for yor database:
Code: Select all
 $connect = mysql_connect("localhost","robbyjb","");
 if (!$connect)
 {echo "Sorry"}
 

2 Read carefuly message about your Warning
3 Read carefully http://www.nelie.org/robbyjb/sql1.php
4 What is value of your variable $resultid?
5 And once more check your database, whats field in, and how you call this.

I'm not tell about yours mistake you need see self.

P.S.
If you don't want what your site hack before you write code do not use original database name, user and his password. some peaple can use this
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Re: Call to undefined function: () in /isp/home/max on line

Postby Oleg Butuzov » Fri Jul 19, 2002 2:24 am

robbyjb wrote:<?php

$connect = mysql_connect("localhost","robbyjb","");
$mysql_select_db("robbyjb", $link);

$query=mysql_query("SELECT * FROM 'psytrance' ", $link);

for ($i=0; $i < mysql_num_rows($query); $i++)

while($row = mysql_fetch_array($result))
{
echo$row["record"];
}
?>
I viewed the psytrance.myi form & .frm .myd using zend at there ftp site & they appeared to be there intact.



can oyu tell me where are you find in my code while


Code: Select all
for ($i=0; $i < mysql_num_rows($query); $i++)

while($row = mysql_fetch_array($result))
{
echo$row["record"];
}
?>


of course it is not work...

truly

Code: Select all
<?
for ($i=0; $i < mysql_num_rows($query); $i++)
{
$row = mysql_fetch_array($result);
echo$row["record"];
}
?>
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Re: Call to undefined function: () in /isp/home/max on line

Postby Jay » Thu Aug 01, 2002 2:29 pm

robbyjb wrote:<?php

$connect = mysql_connect("localhost","robbyjb","");
$mysql_select_db("robbyjb", $link);

$query=mysql_query("SELECT * FROM 'psytrance' ", $link);

for ($i=0; $i < mysql_num_rows($query); $i++)

while($row = mysql_fetch_array($result))
{
echo$row["record"];
}
?>
I viewed the psytrance.myi form & .frm .myd using zend at there ftp site & they appeared to be there intact.

Your code seems to be fine, if all you're trying to do is output the 'record' column. If you don't have a record column then nothing will be output. You might also try putting a space in your loop between the command and the variable, eg
echo $row["record"];
Jay
 


Return to mySQL & php coding

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.