fejl??? jump

Tags:    php


fatter det ikke jeg får hele tiden den her fejl:
http://www.younk.dk/fejl.JPG
min kode ser sådan her ud

<?

unset($id_site_ses);
session_start();
session_register("id_site_ses");

$id=intval($id);
$id1=intval($id1);
$id2=intval($id2);

require("error_inc.php");
require("config_inc.php");

$query = "select br,type,own,idc from ".$t_user.",".$t_idu_idc." where id=".$id." and id=idu ";
$result = MYSQL_QUERY($query);
while($row = mysql_fetch_array($result)){
$cat[]=$row["idc"];
}

$type=mysql_result($result,0,"type");
$br=mysql_result($result,0,"br");
$own=mysql_result($result,0,"own");
@mysql_free_result($result);

if($type==0){
if($br==0){
$cr=$basic_min;
}elseif($br==1){
$cr=$basic_max;
}
}elseif($type==1){
if($br==0){
$cr=$silver_min;
}elseif($br==1){
$cr=$silver_max;
}
}elseif($type==2){
if($br==0){
$cr=$gold_min;
}elseif($br==1){
$cr=$gold_max;
}
}

$query = "select id from ".$t_site." where idu=".$id." order by id";
$result = MYSQL_QUERY($query);

$klv=mysql_num_rows($result);
if($id2>=$klv-1){
$id3=mysql_result($result,0,"id");
$id2=0;
}else{
$id3=mysql_result($result,$id2+1,"id");
$id2++;
}

$query = "update ".$t_site." set credits=credits+".$cr." where id=".$id3;
$result = MYSQL_QUERY($query);

$query = "update ".$t_user." set c".date("w")."=c".date("w")."+".$cr.", cr_earn=cr_earn+".$cr." where id=".$id;
$result = MYSQL_QUERY($query);

for($i=1;($i<=5)and($own!=0);$i++){
$query = "update ".$t_user." set credits=credits+".($ref_cr[$i]*$cr).", c".date("w")."=c".date("w")."+".($ref_cr[$i]*$cr)." where id=".$own;
$result = MYSQL_QUERY($query);
$query = "select own from ".$t_user." where id=".$own;
$result = MYSQL_QUERY($query);
$own=mysql_result($result,0,0);
@mysql_free_result($result);
}

mt_srand((double)microtime()*1000000);
$query = "select distinct(id),url from ".$t_site.",".$t_idm_idc." where idu!=".$id." and id!=".$id1." and b=2 and credits>0 and idm=id and ( ";
$klv=sizeof($cat);
$query.=" idc=".$cat[0];
for($i=1;$i<$klv;$i++){
$query.=" or idc=".$cat[$i];
}
$query=$query." ) ";
for($i=1;$i<count($id_site_ses["id"]);$i++){
if($id_site_ses["time"][$i]>mktime()-$time_autohit){
$query=$query." and id!=".$id_site_ses["id"][$i]." ";
}
}
$query=$query." order by id";
$result = MYSQL_QUERY($query);

$fl=false;
if(mysql_num_rows($result)==1){
$k=0;
}elseif(mysql_num_rows($result)==0){
$fl=true;
}else{
$k=mt_rand(0,mysql_num_rows($result)-1);
}
if($fl==false){
$query1 = "update ".$t_site." set credits=credits-1, pokaz=pokaz+1, p".date("w")."=p".date("w")."+1 where id=".mysql_result($result,$k,"id");
$n=count($id_site_ses["id"]);
$id_site_ses["id"][$n+1]=mysql_result($result,$k,"id");
$id_site_ses["time"][$n+1]=mktime();
$result1 = MYSQL_QUERY($query1);
$url1=mysql_result($result,$k,"url");
$id1=mysql_result($result,$k,"id");
}else{
?>
<script language="Javascript">
parent.topFrame.pause();
</script>
<?
$url1=$url_default;
}




?>
<script language="Javascript">
parent.score=parseInt((parent.score+<?print $cr;?>;)*10);
parent.score=(parent.score)/10;
parent.topFrame.form1.score.value=parent.score;
parent.ida[1]=<?print $id1;?>;
parent.ida[2]=<?print $id2;?>;
parent.url[1]="<?print $url1;?>";
parent.mainFrame.location.href="<?print $url1;?>";
</script>


jeg fik afvide jeg skulle prøve noget or die() ting men er ikke ret god til php så jeg har store problemer med dettet "lorte script"

men håber at i kan hjælpe mig!

/dennis



5 svar postet i denne tråd vises herunder
2 indlæg har modtaget i alt 8 karma
Sorter efter stemmer Sorter efter dato
Fold kodeboks ind/udKode 

find ud af hvilken fejl du får nu



Du har ikke connected til en database. Prøv følgende:

mysql_pconnect("localhost","en_bruger","et_password") or die("Could not connect to MySQL.");
mysql_select_db("en_database") or die("Could not select database.");
$query = "select br,type,own,idc from ".$t_user.",".$t_idu_idc." where id=".$id." and id=idu ";
$result = mysql_query($query) or die("Could not perform search: \\"$query\\"");
while($row = mysql_fetch_array($result)){
$cat[]=$row["idc"];
}



Du har ikke connected til en database. Prøv følgende:

mysql_pconnect("localhost","en_bruger","et_password") or die("Could not connect to MySQL.");
mysql_select_db("en_database") or die("Could not select database.");
$query = "select br,type,own,idc from ".$t_user.",".$t_idu_idc." where id=".$id." and id=idu ";
$result = mysql_query($query) or die("Could not perform search: \\"$query\\"");
while($row = mysql_fetch_array($result)){
$cat[]=$row["idc"];
}


jo det laver den i config_inc.php
""""
require("error_inc.php");
require("config_inc.php");
""""
/dennis



tilføj echo mysql_error(); under querien eller ret die("...") til die(mysql_error())



tilføj echo mysql_error(); under querien eller ret die("...") til die(mysql_error())



øhh er ikke så god til php så plz sæt det ind i mit script!/dennis



t