Schrift
[thread]8826[/thread]

PhpMyAdmin SQL Querys? (Seite 2)

Leser: 1


<< |< 1 2 >| >> 14 Einträge, 2 Seiten
jan
 2007-03-12 20:59
#74909 #74909
User since
2003-08-04
2536 Artikel
ModeratorIn
[Homepage] [default_avatar]
und was ist "der normale code der seite"? ich mein, da müsste ja dann von phpmyadmin auch die mysql-meldung ausgegeben werden ....
tobi2007
 2007-03-12 22:21
#74910 #74910
User since
2007-03-11
11 Artikel
BenutzerIn
[default_avatar]
ok dann machen wir es nochmal zusammen damit du weist was ich meine:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Connection: close
Date: Mon, 12 Mar 2007 17:00:07 GMT
Pragma: no-cache
Server: Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1
Content-Type: text/html; charset=utf-8
Content-Type: text/html; charset=utf-8
Expires: Mon, 12 Mar 2007 17:00:07 GMT
Last-Modified: Mon, 12 Mar 2007 17:00:07 GMT
Client-Date: Mon, 12 Mar 2007 17:00:07 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Link: <./favicon.ico>; /="/"; rel="icon"; type="image/x-icon"
Link: <./favicon.ico>; /="/"; rel="shortcut icon"; type="image/x-icon"
Link: <./css/phpmyadmin.css.php?lang=de-utf-8&convcharset=iso-8859-1&collation_connection=utf8_unicode_ci&token=0cedd2dc5a95f3850b3923399b4b594f&js_frame=right>; /="/"; rel="stylesheet"; type="text/css"
Link: <./css/print.css?lang=de-utf-8&convcharset=iso-8859-1&collation_connection=utf8_unicode_ci&token=0cedd2dc5a95f3850b3923399b4b594f>; /="/"; media="print"; rel="stylesheet"; type="text/css"
Set-Cookie: phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16; path=/phpmyadmin/
Set-Cookie: pma_fontsize=100%25; expires=Wed, 11-Apr-2007 17:00:07 GMT; path=/phpmyadmin/
Set-Cookie: pma_lang=de-utf-8; expires=Wed, 11-Apr-2007 17:00:07 GMT; path=/phpmyadmin/
Set-Cookie: pma_charset=iso-8859-1; expires=Wed, 11-Apr-2007 17:00:07 GMT; path=/phpmyadmin/
Set-Cookie: pma_collation_connection=utf8_unicode_ci; expires=Wed, 11-Apr-2007 17:00:07 GMT; path=/phpmyadmin/
Set-Cookie: pma_theme=darkblue_orange; expires=Wed, 11-Apr-2007 17:00:07 GMT; path=/phpmyadmin/
Title: phpMyAdmin
X-Meta-OBGZip: true
X-Ob-Mode: 0
X-Powered-By: PHP/5.2.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" dir="ltr">
<head>
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;js_frame=right" />
<link rel="stylesheet" type="text/css" href="./css/print.css?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f" media="print" />
<script type="text/javascript" language="javascript">
// <![CDATA[
// Updates the title of the frameset if possible (ns4 does not allow this)
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
&& typeof(parent.document.title) == 'string') {
parent.document.title = 'localhost / localhost | phpMyAdmin 2.9.2';
}

// js form validation stuff
var errorMsg0 = 'Das Formular ist leer !';
var errorMsg1 = 'Das ist keine Zahl!';
var noDropDbMsg = '';
var confirmMsg = 'Möchten Sie wirklich diese Abfrage ausführen ';
var confirmMsgDropDB = 'Sie sind dabei eine komplette Datenbank zu ZERSTÖREN!';
// ]]>
</script>
<script src="./js/functions.js" type="text/javascript" language="javascript"></script>

<script src="./js/tooltip.js" type="text/javascript"
language="javascript"></script>
<meta name="OBGZip" content="true" />
<!--[if IE 6]>
<style type="text/css">
/* <![CDATA[ */
html {
overflow-y: scroll;
}
/* ]]> */
</style>
<![endif]-->
</head>

<body>
<div id="TooltipContainer" onmouseover="holdTooltip();" onmouseout="swapTooltip('default');"></div>
<div class="notice">Ab diesem Punkt müssen Cookies aktiviert sein.</div>
<div id="serverinfo">
<a href="main.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" class="item"> <img class="icon" src="./themes/darkblue_orange/img/s_host.png" width="16" height="16" alt="" />
Server: localhost</a>
</div><div id="topmenucontainer">
<ul id="topmenu">
<li><a class="tab" href="server_databases.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_db.png" width="16" height="16" alt="Datenbanken" />Datenbanken</a></li>
<li><a class="tabactive" href="server_sql.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/b_sql.png" width="16" height="16" alt="SQL" />SQL</a></li>
<li><a class="tab" href="server_status.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_status.png" width="16" height="16" alt="Status" />Status</a></li>
<li><a class="tab" href="server_variables.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_vars.png" width="16" height="16" alt="Variablen" />Variablen</a></li>
<li><a class="tab" href="server_collations.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_asci.png" width="16" height="16" alt="Zeichensätze" />Zeichensätze</a></li>
<li><a class="tab" href="server_engines.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/b_engine.png" width="16" height="16" alt="Formate" />Formate</a></li>
<li><a class="tab" href="server_privileges.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_rights.png" width="16" height="16" alt="Rechte" />Rechte</a></li>
<li><a class="tab" href="server_processlist.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/s_process.png" width="16" height="16" alt="Prozesse" />Prozesse</a></li>
<li><a class="tab" href="server_export.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/b_export.png" width="16" height="16" alt="Exportieren" />Exportieren</a></li>
<li><a class="tab" href="server_import.php?lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" ><img class="icon" src="./themes/darkblue_orange/img/b_import.png" width="16" height="16" alt="Importieren" />Importieren</a></li>
</ul>
<div class="clearfloat"></div></div>
<br />
<form method="post" action="import.php" enctype="multipart/form-data" id="sqlqueryform" onsubmit="return checkSqlQuery(this)" name="sqlform"><input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="de-utf-8" />
<input type="hidden" name="convcharset" value="iso-8859-1" />
<input type="hidden" name="collation_connection" value="utf8_unicode_ci" />
<input type="hidden" name="token" value="0cedd2dc5a95f3850b3923399b4b594f" />

<input type="hidden" name="pos" value="0" />
<input type="hidden" name="goto" value="server_sql.php" />
<input type="hidden" name="zero_rows" value="Ihr SQL-Befehl wurde erfolgreich ausgeführt." />
<input type="hidden" name="prev_sql_query" value="" />
<a name="querybox"></a>
<div id="queryboxcontainer">
<fieldset id="querybox"><input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<legend>SQL-Befehl(e) auf Server localhost ausführen: <a href="http://dev.mysql.com/doc/refman/5.0/en/select.html" target="mysql_doc"><img class="icon" src="./themes/darkblue_orange/img/b_help.png" width="11" height="11" alt="Dokumentation" title="Dokumentation" /></a></legend>
<div id="queryfieldscontainer">
<div id="sqlquerycontainerfull">
<textarea name="sql_query" id="sqlquery" cols="40" rows="7" dir="ltr" onfocus="selectContent( this, sql_box_locked, true )"></textarea>
</div>
<div class="clearfloat"></div>
</div>
<div id="bookmarkoptions">
<div class="formelement">
<label for="bkm_label">
SQL-Abfrage speichern:</label>
<input type="text" name="bkm_label" id="bkm_label" value="" />
</div>
<div class="formelement">
<input type="checkbox" name="bkm_all_users" id="id_bkm_all_users"
value="true" />
<label for="id_bkm_all_users">
Diese gespeicherte SQL-Abfrage für jeden Benutzer verfügbar machen</label>
</div>
<div class="formelement">
<input type="checkbox" name="bkm_replace" id="id_bkm_replace"
value="true" />
<label for="id_bkm_replace">
Überschreibe gleichnamiges Bookmark</label>
</div>
</div>
<div class="clearfloat"></div>
</fieldset>
</div>
<fieldset id="queryboxfooter" class="tblFooters"><input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<div class="formelement">
</div>
<div class="formelement">
<label for="id_sql_delimiter">[ Begrenzer</label>
<input type="text" name="sql_delimiter" size="3" value=";" id="id_sql_delimiter" /> ]
<input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />
<label for="checkbox_show_query">SQL-Befehl hier wieder anzeigen</label>
</div>
<input type="submit" name="SQL" value="OK" />
<div class="clearfloat"></div>
</fieldset>
</form>
<script type="text/javascript" language="javascript">
//<![CDATA[


// set current db, table and sql query in the querywindow
if (window.parent.refreshNavigation) {
window.parent.reload_querywindow(
'',
'',
'');
}


if (window.parent.frame_content) {
// reset content frame name, as querywindow needs to set a unique name
// before submitting form data, and navigation frame needs the original name
if (window.parent.frame_content.name != 'frame_content') {
window.parent.frame_content.name = 'frame_content';
}
if (window.parent.frame_content.id != 'frame_content') {
window.parent.frame_content.id = 'frame_content';
}
//window.parent.frame_content.setAttribute('name', 'frame_content');
//window.parent.frame_content.setAttribute('id', 'frame_content');
}
//]]>
</script>
<div id="selflink" class="print_ignore">
<a href="index.php?server=1&amp;target=server_sql.php&amp;lang=de-utf-8&amp;convcharset=iso-8859-1&amp;collation_connection=utf8_unicode_ci&amp;token=0cedd2dc5a95f3850b3923399b4b594f&amp;phpMyAdmin=a0bf1e7540eacb9f946220ba5bcc2e16" title="Neues phpMyAdmin-Fenster" target="_blank"><img class="icon" src="./themes/darkblue_orange/img/window-new.png" alt="Neues phpMyAdmin-Fenster" />Neues phpMyAdmin-Fenster</a>
</div>
</body>
</html>
jan
 2007-03-12 22:39
#74911 #74911
User since
2003-08-04
2536 Artikel
ModeratorIn
[Homepage] [default_avatar]
ok. das formular von phpmyadmin zum ausführen von sql sieht deutlich anders aus als das, was du da übergibst.

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<form method="post" action="import.php"  enctype="multipart/form-data" id="sqlqueryform" onsubmit="return checkSqlQuery(this)" name="sqlform">
<input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="de-utf-8" />
<input type="hidden" name="convcharset" value="iso-8859-1" />
<input type="hidden" name="collation_connection" value="utf8_unicode_ci" />
<input type="hidden" name="token" value="0cedd2dc5a95f3850b3923399b4b594f" />
<input type="hidden" name="pos" value="0" />
<input type="hidden" name="goto" value="server_sql.php" />
<input type="hidden" name="zero_rows" value="Ihr SQL-Befehl wurde erfolgreich ausgef&� />
<input type="hidden" name="prev_sql_query" value="" />
<input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<textarea name="sql_query" id="sqlquery" cols="40" rows="7" dir="ltr" onfocus="selectContent( this, sql_box_locked, true )"></textarea>
<input type="text" name="bkm_label" id="bkm_label" value="" />
<input type="checkbox" name="bkm_all_users" id="id_bkm_all_users" value="true" />
<input type="checkbox" name="bkm_replace" id="id_bkm_replace" value="true" />
<input type="hidden" name="phpMyAdmin" value="a0bf1e7540eacb9f946220ba5bcc2e16" />
<input type="text" name="sql_delimiter" size="3" value=";" id="id_sql_delimiter" /> ]
<input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />
<input type="submit" name="SQL" value="OK" />

...

ich habe mal vor einiger zeit phpmyadmin als db-proxy nutzen müssen, um eine datenbank zu exportieren. die db war zu groß, um sie in einem stück zu ziehen, da php dann ständig abbrach. also musste ich sie stückweise ziehen. dazu musste ich wissen, wieviele einträge in einer tabelle sind, also musste ich vorher ein select count(id) machen. der aufruf dabei sah so aus (die phpmyadmin-version erinnere ich nicht, aber da's schon ein weilchen her ist, war's eher älter. keine authentifizierung in phpmyadmin wie's heute ist).
Code: (dl )
1
2
3
4
    my $req = HTTP::Request->new('POST', 'https://www.example.tld/phpmyadmin/read_dump.php', $headers);
$req->content_type('application/x-www-form-urlencoded');
$req->content('is_js_confirmed=0&lang=de-iso-8859-1&server=1&db=ati&pos=0&goto=db_details.php&zero_rows=' . uri_escape('Ihr SQL-Befehl wurde erfolgreich ausgeführt.') . '&prev_sql_query=&sql_query=' . uri_escape($query) . '&show_query=1&sql_file_compression=&');
$req->content_length(length($req->content));


das funktionierte. möglicherweise ist der content_type relevant? oder eines der form-felder, die du nicht übergeben hast. ich bin kein fan der kurz-form-schreibweise bei requests, ich mach's immer umständlich aber dafür hab ich immer den eindruck, es übersichtlicher zu haben und alles machen zu können, wie ich es will. hope that helps.
tobi2007
 2007-03-13 19:28
#74912 #74912
User since
2007-03-11
11 Artikel
BenutzerIn
[default_avatar]
ich danke euch für die super hilfe111
es lag nun daran das ich den post request auf server_sql.php anstatt auf import.php gemacht habe.

jetzt funktioniert es einwandfrei
<< |< 1 2 >| >> 14 Einträge, 2 Seiten



View all threads created 2007-03-11 21:59.