Fass schreef:Alle tickets apart ophalen, nu haalt hij alleen 1tje eruit, maar als er meerdere tickets instaat en ik open ze, blijft dezelfde text erin staan als die ene.Wat hij nu doet is de eerste ticket ophalen? Wat wil je dan?
Kleine Vragen Topic #1
Waarom kies je voor objecten?
Kunnen jullie het alsjeblieft voor mij inbouwen ?
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM tickets ORDER BY ticket ASC"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]// mysql error[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="datum">
<span>
[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]naam [COLOR= #007700].[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]achternaam [COLOR= #007700].[/COLOR][COLOR= #DD0000]
</span>
schreef op: [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]datum [COLOR= #007700].[/COLOR][COLOR= #DD0000], om[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]tijd [COLOR= #007700].[/COLOR][COLOR= #DD0000]
</div>[/COLOR][COLOR= #007700];
}
}[/COLOR] Rogier schreef:Waarom objecten? Neem fetch_assoc, dat is sneller.[COLOR= #0000BB]<?php $query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM tickets ORDER BY ticket ASC"[/COLOR][COLOR= #007700]);[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700]) {[/COLOR] [COLOR= #FF8000]// mysql error[/COLOR] [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="datum"> <span> [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]naam [COLOR= #007700].[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]achternaam [COLOR= #007700].[/COLOR][COLOR= #DD0000] </span> schreef op: [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]datum [COLOR= #007700].[/COLOR][COLOR= #DD0000], om[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]tijd [COLOR= #007700].[/COLOR][COLOR= #DD0000] </div>[/COLOR][COLOR= #007700]; } }[/COLOR]
Antonn schreef:Waarom objecten? Neem fetch_assoc, dat is sneller.Eerdere citaten tonen
Rogier schreef:[COLOR= #0000BB]<?php $query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM tickets ORDER BY ticket ASC"[/COLOR][COLOR= #007700]);[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700]) {[/COLOR] [COLOR= #FF8000]// mysql error[/COLOR] [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="datum"> <span> [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]naam [COLOR= #007700].[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]achternaam [COLOR= #007700].[/COLOR][COLOR= #DD0000] </span> schreef op: [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]datum [COLOR= #007700].[/COLOR][COLOR= #DD0000], om[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]tijd [COLOR= #007700].[/COLOR][COLOR= #DD0000] </div>[/COLOR][COLOR= #007700]; } }[/COLOR]
Gast, ik programmeer nu lang genoeg om mijn eigen keuzes te maken. Objecten werken bijna hetzelfde als arrays (assoc). Maar aangezien ik altijd met een framework werk. En dus heel erg veel met objecten werk. Gebruik ik mysql_fetch_object. Die functie is er ook niet voor niets he.
En waarom zou ik mij moeten verantwoorden aan jou?
Ik probeer met JQuery een Json object optehalen alleen laat hij niets zien.
het is overigens voor het eerst dat ik dit met JQuery doe
het is overigens voor het eerst dat ik dit met JQuery doe
function fetch_feed(){
$.getJSON(ULRNAARJSON, function(data) {
var items = [];
for (var i=0; i< data.length; i++) {
items.push(<div class="title"><p>+data[i].title+ - +data[i].date+</p></div><div class="avatar"><img src="+data[i].avatar+" /></div><div class="desc">+data[i].desc+</div>);
}
$(<div>, {
class: post,
html: items.join()
}).appendTo(#popup);
});
} {
"post": [
"title":"Titel test bla bla",
"url":"Url",
"desc":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nibh arcu, condimentum nec ultricies sit amet, rhoncus nec nunc. Proin rhoncus, est ac egestas tempus, metus mi mollis odio, sed convallis elit ante aliquet augue. Sed mattis nibh quis ",
"avatar":"http://www.static.sevvlor.com/users/avatars/thumbs/thumbnail-1-2k6hz.jpg",
"name":"Sevvlor",
"date":"Gister"
]
} Rogier schreef:Gast, ik programmeer nu lang genoeg om mijn eigen keuzes te maken. Objecten werken bijna hetzelfde als arrays (assoc). Maar aangezien ik altijd met een framework werk. En dus heel erg veel met objecten werk. Gebruik ik mysql_fetch_object. Die functie is er ook niet voor niets he.Waarom objecten? Neem fetch_assoc, dat is sneller.Eerdere citaten tonen
Antonn schreef:Eerdere citaten tonen
Rogier schreef:[COLOR= #0000BB]<?php $query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM tickets ORDER BY ticket ASC"[/COLOR][COLOR= #007700]);[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]===[/COLOR] false[COLOR= #007700]) {[/COLOR] [COLOR= #FF8000]// mysql error[/COLOR] [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_object"]mysql_fetch_object[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="datum"> <span> [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]naam [COLOR= #007700].[/COLOR] [COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]achternaam [COLOR= #007700].[/COLOR][COLOR= #DD0000] </span> schreef op: [/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]datum [COLOR= #007700].[/COLOR][COLOR= #DD0000], om[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700]->[/COLOR]tijd [COLOR= #007700].[/COLOR][COLOR= #DD0000] </div>[/COLOR][COLOR= #007700]; } }[/COLOR]
En waarom zou ik mij moeten verantwoorden aan jou?
Gast, ik geef je een tip om je site sneller en dus beter te maken. En als ke dus toch al zo lang script word het dus nodig tijd om over te stappen op mysql_fetch_assoc.
Kun je een website aanpassen voor alleen jezelf? Onze schoolsite is namelijk aangepast en wil er een extra button onderzetten omdat deze er vroeger ook altijd zat.
En dit moet gewoon een klikbare img worden. En enkel om mijn pc/ip.
En dit moet gewoon een klikbare img worden. En enkel om mijn pc/ip.
Antonn zei element inspecteren maar dat gaat niet werken.
Sanderc schreef:Inderdaad kan enkel eenmalig dan.Antonn zei element inspecteren maar dat gaat niet werken.
Robindesign schreef:Misschien met een chrome extensie oid?Kun je een website aanpassen voor alleen jezelf? Onze schoolsite is namelijk aangepast en wil er een extra button onderzetten omdat deze er vroeger ook altijd zat.
En dit moet gewoon een klikbare img worden. En enkel om mijn pc/ip.
Iemand die weet hoe je dat fixt?
IPB werkt echt lekker. 
