MyBB.de Forum
Mysql formular Variable - Druckversion

+- MyBB.de Forum (https://www.mybb.de/forum)
+-- Forum: Sonstiges (https://www.mybb.de/forum/forum-1.html)
+--- Forum: Programmierung (https://www.mybb.de/forum/forum-32.html)
+--- Thema: Mysql formular Variable (/thread-15173.html)

Seiten: Seiten: 1 2 3


RE: Mysql formular Variable - Marti95. - 30.11.2009

PHP-Code:
mysql_query("UPDATE `".$prefix."page` Set `UPDATE_SPALTE!!` = '$UPDATE_INHALT' WHERE id = '$id'") or die("Fehler beim speichern!<br><br>".mysql_error()); 



RE: Mysql formular Variable - Blackout - 30.11.2009

danke =) no database selected -.- hae?
Was bedeutet das mit where id also meine Tabelle hat nur die Spalte Inhalt und die Tabelle heißt news

mysql_query("UPDATE `".$prefix."anotherone_nf` Set `News` = '$etwas' WHERE id = '$id'") or die("Fehler beim speichern!<br><br>".mysql_error());

Schreib wenns dir zu viel dämlichkeit is Big Grin


RE: Mysql formular Variable - Marti95. - 30.11.2009

PHP-Code:
mysql_query("UPDATE `News` Set `inhalt` = '$etwas' WHERE inhalt = '$inhalt_old'") or die("Fehler beim speichern!<br><br>".mysql_error()); 



RE: Mysql formular Variable - Blackout - 30.11.2009

PHP-Code:
<html>
<
head>
<
title>Daten verarbeiten</title>
</
head>
<
body>

<?
php

$host 
"localhost";
$user "";
$password "";
$dbname "anotherone_nf";
$tabelle ="News";


$etwas $_POST['artikel'];


$dbverbindung mysql_connect ($host$user$password);




mysql_query("UPDATE `News` Set `Inhalt` = '$etwas' WHERE Inhalt = '$Inhalt_old'") or die("Fehler beim speichern!<br><br>".mysql_error()); 

 
    
mysql_close ($dbverbindung);

?>


</body>
</html> 

Da kommt jetzt
Fehler beim speichern!

No database selected
wie kann ich die datenbank auswählen?! Hae der muss doch wissen welche ich nehm ich hab ja nur die verbindung zu der einen DB?!. Die Variable bekomm ich von dem php Formular, mit dem Stimmt alles...


RE: Mysql formular Variable - Marti95. - 30.11.2009

PHP-Code:
<?php
        $dbHost 
"localhost";
        
$dbUser "....";
        
$dbPass "****";
        
$dbName "....";
        
$prefix "....";
        
$connect = @mysql_connect($dbHost$dbUser$dbPass) or die("Konnte keine Verbindung zum Datenbankserver aufbauen!");
        
$selectDB = @mysql_select_db($dbName$connect) or die("Konnte die Datenbank <b>$dbName</b> nicht auswählen!");
              
?>



RE: Mysql formular Variable - Blackout - 30.11.2009

jo jetz konnte ich einne eintrag hinzufügen und danach nix mehr Big Grin..kann des sein dass des an meiner DB bzw tabelle liegt? Wie muss die Genau aussehn... weil ich glaub des liegt daran, dass immer n neuer Eintrag erstellt wird.


RE: Mysql formular Variable - Marti95. - 30.11.2009

Code:
CREATE TABLE IF NOT EXISTS `smarty_s_page` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `page_title` varchar(200) NOT NULL,
  `page_content` text NOT NULL,
  `user_id` int(10) NOT NULL,
  `datum` int(20) NOT NULL,
  `only_user` varchar(5) NOT NULL DEFAULT 'no',
  `home` varchar(5) NOT NULL DEFAULT 'no',
  `sorting` int(10) NOT NULL,
  `active` varchar(5) NOT NULL DEFAULT 'yes',
  `php_code` varchar(5) NOT NULL DEFAULT 'no',
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
So sieht das bei mir aus Wink
Code:
CREATE TABLE IF NOT EXISTS `smarty_s_page` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `page_title` varchar(200) NOT NULL,
  `page_content` text NOT NULL,
  KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

Das sollte für dich reichen
Einfach im PHPmyAdmin bei SQL einfügen

Und ein paar tutorials lessen Wink


RE: Mysql formular Variable - Blackout - 30.11.2009

so also hab ich jetz gemacht.. per phpmyAdmin was reingeschrieben. Und mithilfe der Seite versucht upzudaten...aber iwie ändert das nichts..
Kann das iwie was mit der $id zu tun haben? Die hab ich ja nich bestimmt.?


RE: Mysql formular Variable - Marti95. - 30.11.2009

Bitte liess dir ein par Tutorials durch.

http://www.schattenbaum.net/php/mstart.php


RE: Mysql formular Variable - Blackout - 30.11.2009

des hab ich au scho gfunde...joa habs jetz mal selber geschafftt^^ statt $id --> 1 .. Big GrinBig GrinBig Grin
Learning by doing Big GrinBig Grin ich find son tutorial besser indem ich andre leute aufn wecker geh Big Grin
Sorry aber viel dank =)

WEnn ich mal gaaanz viel Zeit hab les ich mal n tutorial Big Grin
jetz noch tinymce einbauen..kann ja jetz nemem so schwer sein Big Grin
vlt doch ned so ganz einfach Big Grin
WIE GEIL DANKESCHÖÖÖN! Editor integriert... =) stimmt es so?
'SELECT
page_content
FROM
ccms
ORDER BY
page_content DESC';
also dass steht "in" dem textfeld von tinymce um den Aktuellen eintrag zu sehen. Ist das so Richtig /Konform?