Register for your free account! | Forgot your password?

You last visited: Today at 10:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Title

Discussion on Title within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2012
Posts: 123
Received Thanks: 16
Title

PHP Code:
<title>

<?php 

 
include('config/database.php');
 
$title "SELECT title FROM index";
 
$title2 mysql_query($title) or die ("Anfrage nicht erfolgreich.");
 
$row mysql_fetch_object($title2);
 
 echo 
$row

?>  

</title>
Was ist daran falsch er gibt im Header an das die Anfrage nicht erfolgreich aus...? Ist das Script so richtig?
eBay Advertising is offline  
Old 07/04/2012, 14:04   #2
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
Als 1.
wird die db verbindung in der config aufgebaut?

Als 2. Du hast einen fetch_object greifst aber nicht auf das objekt zu ... richtig wäre --> $row->title;
NotEnoughForYou is offline  
Old 07/04/2012, 14:14   #3
 
elite*gold: 0
Join Date: Jun 2012
Posts: 123
Received Thanks: 16
PHP Code:
<title>

<?php 

 
include('database.php');
 
$title "SELECT title FROM index";
 
$title2 mysql_query($title) or die ("Anfrage nicht erfolgreich.");
 
$row mysql_fetch_object($title2);
 
 echo 
$row->title

?>  

</title>

PHP Code:
<?php

$mysqlhost
="localhost"

$mysqluser="*******"

$mysqlpass"****"

$mysqldbase="******"

 

$connection=mysql_connect($mysqlhost$mysqluser$mysqlpass) or die

(
"Verbindung nicht moeglich.");

 

mysql_select_db($mysqldbase$connection) or die("Datenbank konnte nicht gewaehlt werden.");

?>
Geht nicht.
eBay Advertising is offline  
Old 07/04/2012, 14:16   #4
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
lass dir mal den mysql_error ausgeben
NotEnoughForYou is offline  
Old 07/04/2012, 14:19   #5
 
elite*gold: 0
Join Date: Jun 2012
Posts: 123
Received Thanks: 16
Wo soll ich mir den ausgeben lassen im Header?
eBay Advertising is offline  
Old 07/04/2012, 14:21   #6
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
mach
PHP Code:
$title2 mysql_query($title) or die (mysql_error()); 
da stoppt es ja anscheinend
NotEnoughForYou is offline  
Old 07/04/2012, 14:24   #7
 
elite*gold: 0
Join Date: Jun 2012
Posts: 123
Received Thanks: 16
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'index' at line 1
eBay Advertising is offline  
Old 07/04/2012, 14:25   #8
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
index ist ein reserviertes sql wort... db umbennen dann müsste es eigentlich gehen weil sonst kein fehler drin ist
NotEnoughForYou is offline  
Old 07/04/2012, 14:30   #9
 
elite*gold: 0
Join Date: Jun 2012
Posts: 123
Received Thanks: 16
Ok geht danke
eBay Advertising is offline  
Old 07/05/2012, 10:56   #10
 
elite*gold: 0
Join Date: Oct 2008
Posts: 319
Received Thanks: 88
Quote:
$title = mysql_query("SELECT title FROM `ìndex`") or die ("Anfrage nicht erfolgreich.");
Escaped quasi reservierte Wörter in SQL Querys. Hört doch bitte auf unnötig Variablen für SQL Querys anzulegen, ist ja nicht so als ob das irgentwelche Vorteile hätte sondern frisst auf Dauer einfach nur immens Performance. Das kann ich mir garnicht ansehn.
Fratyr is offline  
Reply


Similar Threads Similar Threads
WTB GW acc +20 HoM title
03/29/2012 - Guild Wars Trading - 0 Replies
hallo wie der title schon sagt suche und kaufe ich einen gw acc mit min oder ca 15-20 max title in der HoM egal welche chars oder so ich bezahle per paypal angebote pls pn me
Title
12/09/2011 - DarkOrbit - 3 Replies
Is there a place where i can sell my titles on the forum ^^ or is even someone interested?
[WTS] Account including all 4 campaigns + Wisdom Title [3] + Treasure title [near 3]
09/06/2009 - Guild Wars Trading - 6 Replies
: Hi, I'm sellin an Account including all 3 campaigns & EOTN. It has no characters on it except an PvP Elementalist. There are some green items and materials on storage, and 11 golden rin relicts It's not plaync-bounded!! I'm open for offers. (ectos, zkeys, rare pets or rare items only) Contact: ..: 195759396
Title
07/05/2008 - Runescape - 0 Replies
Hey guys im selling a lvl 91 account with full dharoks for a conquer online account perferably lvl 110-115 or any server in nater-??????? THANKS!:eek::eek::eek::eek::):):):);););):D:D:D:D
How edit topic title? New title.
09/01/2007 - Conquer Online 2 - 2 Replies
Since forum turned vbulletin, i cant edit topic title



All times are GMT +1. The time now is 10:37.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.