Jump to content

sax

Members
  • Posts

    4
  • Joined

  • Last visited

sax's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hy to all, basicly all I want to do is: I have an array of three elements, the firt to elements can be a string or a number for example. vect[0]=12, vect[1]=JULY, or vect[0]=first,vect[1]=2 and so on. all I want to do is to change the array value in base of it value. so if vect[0]=first I want to substitute it with 1, and if vect[1]=JULY I want to substitute it with 7. The only solution I can think of is to make a series of IF's but I don't like it, I think there is a bettere way to do it. this is my script $date = "riunione del 1/aprile/1969 orco zio"; $p="!(primo|due|tre|quattro|cinque|sei|sette|otto|nove|dieci|undici|dodici|tredici|quattordici|quindici|sedici|diciassette|diciotto|diciannove|venti|ventuno|ventidue|ventitre|ventitrĂ©|ventitrè|ventiquattro|venticinque|ventisei|ventisette|ventotto|ventinove|trenta|trentuno|PRIMO|DUE|TRE|QUATTRO|CINQUE|SEI|SETTE|OTTO|NOVE|DIECI|UNDICI|DODICI|TREDICI|QUATTORDICI|QUINDICI|SEDICI|DICIASSETTE|DICIOTTO|DICIANNOVE|VENTI|VENTUNO|VENTIDUE|VENTITRE|VENTITRÉ|VENTITRĂˆ|VENTIQUATTRO|VENTICINQUE|VENTISEI|VENTISETTE|VENTOTTO|VENTINOVE|TRENTA|TRENTUNO|\d(?:\d)?)[-/](GENNAIO|FEBBRAIO|MARZO|APRILE|MAGGIO|GIUGNO|LUGLIO|AGOSTO|SETTEMBRE|OTTOBRE|NOVEMBRE|DICEMBRE|gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre|[0-9])[-/](\d\d(?:\d\d)?)*!"; if (preg_match($p,$date,$matches)) { echo $matches[1]; echo $matches[2]; echo $matches[3]; } some has some ideas? thank's
  2. sorry fot he copy/paste but I posted a couple of days ago on the other forum and nobody answered, and since I couldn't find I answer I changed forum! thanks for the answer, now it seems like it's working
  3. edit: i'm using xamp 1.8.1 like mysql server!!
  4. Hy I'm trying to execute this query $stmt = $mysqli->prepare("SELECT streamer,content,provider FROM evento,canali WHERE canali.id=evento.idcanale AND evento.titolo LIKE '%?%' OR evento.sottotitolo LIKE '%?%' AND evento.datainizio=2013-02-21;"); $stmt->bind_param('ss',$tok,$tok); $stmt->execute(); $stmt->close(); but I get this error Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement. but to me it seems like the number are the same, you can see how I prepared the statement with 2 arguments to define, and then I passe 2 arguments to add_param, what I'm getting wrong? some has some ideas? thanks daniele New php-forum User Posts: 2 Joined: Fri May 03, 2013 6:48 pm
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.