You are here: Variable doesn't get populated « All PHP « IT news, forums, messages
Variable doesn't get populated

Posted by Raj on 10/20/05 21:03

Hi,

If I enter in a browser

http://localhost/~raj/fdd/start.php?s=tfdd

The folllowing script outputs

9tfdd99

It appears that the script doesn't get as far as the SQL. I don't know why. I
dontl get informed of any errors.

$num does not get populated. I think it should be 0 if the query above it
returns no values. Can someone tell me why it doesn't get populated at least
with a zero..

Please help.

Thanks,

Raj (newbie)


Here is the code:

start.php

<?php
session_start();
session_destroy();
include("./general_scripts_etc/header1.php");
$s=$_GET['s'];
print("9");
print($s);
print("9");
$query="SELECT * FROM site_data WHERE site_name=$s";
$result=@mysql_query($query);
$num=mysql_num_rows($result);
print($num);
print("9");
if ($num==0)
{
$query="SELECT * FROM site_data WHERE site_number='1'";
$result=@mysql_query($query);
while ($Row=mysql_fetch_array($result))
{
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_location']=$Row[site_logo_location];
$_SESSION['site_admin_email']=$Row[site_admin_email];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Location: intro_page.php");
}
}
if ($num==1)
{
while ($Row=mysql_fetch_array($result))
{
$_SESSION['site_name']=$Row[site_name];
$_SESSION['site_logo_location']=$Row[site_logo_location];
$_SESSION['site_admin_email']=$Row[site_admin_email];
$_SESSION['site_number']=$Row[site_number];
ob_end_clean();
header("Location: intro_page.php");
}
}
include("./general_scripts_etc/footer1.php");
?>


header1.php

<?php
ob_start();
session_start();
include('../outer/mysql_connect_fdd.php');

//limit is number of users listed per search page
$limit=10;

//live_limit is time to wait till offline
$live_limit=15*60;

//the limit to the number of pages appearing on the bottom of pages
$menu_max=25;

//log refrsh time
$log_refresh=30;

//time to wait till wipe instant message - seconds
$instant_message_wipe=15*60;

//time to wait till wipe old other - seconds
$other_points_wipe=30*24*60*60;

//address to send photos for verification
$photo_verify_address="http://www.freedatingdatabase.com/admin777/photo_verifi
cation.php?user_id="
?>


footer1.php

<?php
ob_end_flush();
?>


mysql_connect_fdd.php

<?
define('DB_USER', 'lkjsdflkdf');
define('DB_PASSWORD', 'lkhjdsflkhj');
define('DB_HOST', 'localhost');
define ('DB_NAME', 'db1');
$dbc=@mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect
to database. Please try later. Error: '.mysql_error());;
mysql_select_db(DB_NAME);
@mysql_select_db (DB_NAME) OR die ('Could not select the
database:'.mysql_error());
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация